diff --git a/base-foc/include/signal_session/source_client.h b/base-foc/include/signal_session/source_client.h index 28bfbbe55..ae87b670c 100644 --- a/base-foc/include/signal_session/source_client.h +++ b/base-foc/include/signal_session/source_client.h @@ -72,6 +72,9 @@ namespace Genode { ** Signal source interface ** *****************************/ + /* Build with frame pointer to make GDB backtraces work. See issue #1061. */ + __attribute__((optimize("-fno-omit-frame-pointer"))) + __attribute__((noinline)) Signal wait_for_signal() { using namespace Fiasco; diff --git a/base-foc/src/base/ipc/ipc.cc b/base-foc/src/base/ipc/ipc.cc index 649002e35..b8731851a 100644 --- a/base-foc/src/base/ipc/ipc.cc +++ b/base-foc/src/base/ipc/ipc.cc @@ -224,6 +224,9 @@ Ipc_ostream::Ipc_ostream(Native_capability dst, Msgbuf_base *snd_msg) ** Ipc_istream ** *****************/ +/* Build with frame pointer to make GDB backtraces work. See issue #1061. */ +__attribute__((optimize("-fno-omit-frame-pointer"))) +__attribute__((noinline)) void Ipc_istream::_wait() { l4_umword_t label = 0; diff --git a/base-foc/src/base/ipc/pager.cc b/base-foc/src/base/ipc/pager.cc index fc1ad7c45..7cf0acd12 100644 --- a/base-foc/src/base/ipc/pager.cc +++ b/base-foc/src/base/ipc/pager.cc @@ -60,6 +60,9 @@ void Ipc_pager::_parse_msg_type() } +/* Build with frame pointer to make GDB backtraces work. See issue #1061. */ +__attribute__((optimize("-fno-omit-frame-pointer"))) +__attribute__((noinline)) void Ipc_pager::wait_for_fault() { l4_umword_t label; diff --git a/base-foc/src/base/lock/lock_helper.h b/base-foc/src/base/lock/lock_helper.h index 68221f098..6e6027f82 100644 --- a/base-foc/src/base/lock/lock_helper.h +++ b/base-foc/src/base/lock/lock_helper.h @@ -79,7 +79,12 @@ static inline void thread_switch_to(Genode::Thread_base *thread_base) /** * Unconditionally block the calling thread */ -static inline void thread_stop_myself() + +/* Build with frame pointer to make GDB backtraces work. See issue #1061. */ +__attribute__((optimize("-fno-omit-frame-pointer"))) +__attribute__((noinline)) +__attribute__((used)) +static void thread_stop_myself() { using namespace Fiasco; diff --git a/base-foc/src/core/irq_session_component.cc b/base-foc/src/core/irq_session_component.cc index 33fb5d119..b3a8196b3 100644 --- a/base-foc/src/core/irq_session_component.cc +++ b/base-foc/src/core/irq_session_component.cc @@ -224,6 +224,9 @@ Irq_session_component::~Irq_session_component() { ** Interrupt handler implemtentation ** ***************************************/ +/* Build with frame pointer to make GDB backtraces work. See issue #1061. */ +__attribute__((optimize("-fno-omit-frame-pointer"))) +__attribute__((noinline)) void Interrupt_handler::entry() { using namespace Fiasco; diff --git a/base-foc/src/core/platform.cc b/base-foc/src/core/platform.cc index 3ae605343..e43db9c3c 100644 --- a/base-foc/src/core/platform.cc +++ b/base-foc/src/core/platform.cc @@ -64,6 +64,10 @@ static unsigned long _core_pager_stack[PAGER_STACK_ELEMENTS]; /** * Core pager "service loop" */ + +/* Build with frame pointer to make GDB backtraces work. See issue #1061. */ +__attribute__((optimize("-fno-omit-frame-pointer"))) +__attribute__((noinline)) static void _core_pager_loop() { using namespace Fiasco; diff --git a/ports/run/gdb_monitor.run b/ports/run/gdb_monitor.run index d241bc755..32eec7b4c 100644 --- a/ports/run/gdb_monitor.run +++ b/ports/run/gdb_monitor.run @@ -228,14 +228,14 @@ if {![regexp {Program received signal SIGSEGV, Segmentation fault.} $gdb_output] exit -1 } -if {![regexp {Genode::Ipc_istream::_wait} $gdb_output] || - ![regexp {Genode::Ipc_server::_wait} $gdb_output] || - ![regexp {Genode::sleep_forever ()} $gdb_output]} { +if {![regexp {thread_stop_myself \(\)} $gdb_output] || + ![regexp {Genode::Cancelable_lock::lock \(this=} $gdb_output] || + ![regexp {Genode::Thread_base::join \(this=} $gdb_output] || + ![regexp {in main \(\)} $gdb_output]} { + + puts stderr "Error: Stack trace when in syscall is not as expected" + exit -1 - if {![have_spec nova]} { - puts stderr "Error: Stack trace when in syscall is not as expected" - exit -1 - } } puts "Test succeeded" diff --git a/ports/src/test/gdb_monitor/main.cc b/ports/src/test/gdb_monitor/main.cc index fde4594ab..06a0ea7f8 100644 --- a/ports/src/test/gdb_monitor/main.cc +++ b/ports/src/test/gdb_monitor/main.cc @@ -89,7 +89,7 @@ int main(void) test_thread.start(); - Genode::sleep_forever(); + test_thread.join(); return 0; }