diff options
author | Tom Tromey <tromey@adacore.com> | 2020-08-07 10:26:45 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2020-08-07 10:26:45 -0600 |
commit | e95465793dedc0a75406c159ad3180d55cd4a94d (patch) | |
tree | 2206bf09f482d44f2d857387760d8188226f6840 /gdb/ravenscar-thread.c | |
parent | 3d4470e5d482ba5908651feb246d110453c8f31b (diff) | |
download | binutils-e95465793dedc0a75406c159ad3180d55cd4a94d.zip binutils-e95465793dedc0a75406c159ad3180d55cd4a94d.tar.gz binutils-e95465793dedc0a75406c159ad3180d55cd4a94d.tar.bz2 |
Avoid crash in ravenscar_thread_target::wait
An earlier patch caused a Ravenscar regression in
ravenscar_thread_target::wait. In particular, add_active_thread can
return NULL when the runtime is not initialized.
gdb/ChangeLog
2020-08-07 Tom Tromey <tromey@adacore.com>
* ravenscar-thread.c (ravenscar_thread_target::wait): Check
runtime_initialized.
Diffstat (limited to 'gdb/ravenscar-thread.c')
-rw-r--r-- | gdb/ravenscar-thread.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c index 7fca51d..47001de 100644 --- a/gdb/ravenscar-thread.c +++ b/gdb/ravenscar-thread.c @@ -354,7 +354,8 @@ ravenscar_thread_target::wait (ptid_t ptid, because we might try switching threads (and thus sending packets) after the remote has disconnected. */ if (status->kind != TARGET_WAITKIND_EXITED - && status->kind != TARGET_WAITKIND_SIGNALLED) + && status->kind != TARGET_WAITKIND_SIGNALLED + && runtime_initialized ()) { m_base_ptid = event_ptid; this->update_thread_list (); |