diff options
author | Tom de Vries <tdevries@suse.de> | 2021-04-22 17:01:00 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2021-04-22 17:01:00 +0200 |
commit | c39ebbf43faa932a6860fd9c3607503641659898 (patch) | |
tree | 61512754049700961775679c09912af20d61cafc /gdb/remote.c | |
parent | bdd2aaf69ea2e8c89f431bdf72516e2d6503891a (diff) | |
download | gdb-c39ebbf43faa932a6860fd9c3607503641659898.zip gdb-c39ebbf43faa932a6860fd9c3607503641659898.tar.gz gdb-c39ebbf43faa932a6860fd9c3607503641659898.tar.bz2 |
[gdb] Fix assert in remote_async_get_pending_events_handler
Occassionally I run into the following assert:
...
(gdb) PASS: gdb.multi/multi-target-continue.exp: inferior 5
Remote debugging from host ::1, port 49990^M
Process multi-target-continue created; pid = 31241^M
src/gdb/remote-notif.c:113: internal-error: \
void remote_async_get_pending_events_handler(gdb_client_data): \
Assertion `target_is_non_stop_p ()' failed.^M
...
The assert checks target_is_non_stop_p, which is related to the current
target.
Fix this by changing the assert such that it checks non-stopness related to
the event it's handling.
Tested on x86_64-linux.
gdb/ChangeLog:
2021-04-22 Simon Marchi <simon.marchi@polymtl.ca>
Tom de Vries <tdevries@suse.de>
PR remote/27710
* remote.c (remote_target_is_non_stop_p): New function.
* remote.h (remote_target_is_non_stop_p): Declare.
* remote-notif.c (remote_async_get_pending_events_handler): Fix assert
to check non-stopness using notif_state->remote rather current target.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index 7429e1a..2e365df 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -14730,6 +14730,17 @@ remote_target::store_memtags (CORE_ADDR address, size_t len, return packet_check_result (rs->buf.data ()) == PACKET_OK; } +/* Return true if remote target T is non-stop. */ + +bool +remote_target_is_non_stop_p (remote_target *t) +{ + scoped_restore_current_thread restore_thread; + switch_to_target_no_thread (t); + + return target_is_non_stop_p (); +} + #if GDB_SELF_TEST namespace selftests { |