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 | |
parent | 3d4470e5d482ba5908651feb246d110453c8f31b (diff) | |
download | gdb-e95465793dedc0a75406c159ad3180d55cd4a94d.zip gdb-e95465793dedc0a75406c159ad3180d55cd4a94d.tar.gz gdb-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')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/ravenscar-thread.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 81d0527..d1f7058 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2020-08-07 Tom Tromey <tromey@adacore.com> + * ravenscar-thread.c (ravenscar_thread_target::wait): Check + runtime_initialized. + +2020-08-07 Tom Tromey <tromey@adacore.com> + * ravenscar-thread.c (ravenscar_thread_target): Don't call add_active_thread. (ravenscar_thread_target::add_active_thread): Now public. 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 (); |