diff --git a/repos/ports/src/app/gdb_monitor/cpu_session_component.cc b/repos/ports/src/app/gdb_monitor/cpu_session_component.cc index 5c3d2edb32..711a98794a 100644 --- a/repos/ports/src/app/gdb_monitor/cpu_session_component.cc +++ b/repos/ports/src/app/gdb_monitor/cpu_session_component.cc @@ -267,7 +267,8 @@ void Cpu_session_component::kill_thread(Thread_capability thread_cap) Cpu_thread_component *cpu_thread = lookup_cpu_thread(thread_cap); if (cpu_thread) { - genode_remove_thread(cpu_thread->lwpid()); + if (cpu_thread->lwpid()) + genode_remove_thread(cpu_thread->lwpid()); _thread_list.remove(cpu_thread); destroy(_md_alloc, cpu_thread); } else diff --git a/repos/ports/src/app/gdb_monitor/cpu_thread_component.h b/repos/ports/src/app/gdb_monitor/cpu_thread_component.h index ce5f1b1dd6..af994e964a 100644 --- a/repos/ports/src/app/gdb_monitor/cpu_thread_component.h +++ b/repos/ports/src/app/gdb_monitor/cpu_thread_component.h @@ -36,8 +36,8 @@ class Gdb_monitor::Cpu_thread_component : public Rpc_object, Cpu_session_component &_cpu_session_component; Cpu_thread_client _parent_cpu_thread; - unsigned long _lwpid; - addr_t _initial_ip; + unsigned long _lwpid { 0 }; + addr_t _initial_ip { 0 }; /* * SIGTRAP, SIGSTOP and SIGINT must get delivered to the gdbserver code