[04/11] gdb, remote: fix "info program" after reconnect to non-stop target
Checks
| Context |
Check |
Description |
| linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_gdb_check--master-arm |
success
|
Test passed
|
| linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 |
success
|
Test passed
|
Commit Message
From: "Bouhaouel, Mohamed" <mohamed.bouhaouel@intel.com>
After reconnecting to a non-stop remote target that has stopped threads,
"info program" incorrectly reports "The program being debugged is not
being run" instead of showing the stop information. This happens because
the previous_thread global is not updated when processing initial stop
replies.
Fix by calling update_previous_thread () after set_last_target_status ()
in print_one_stopped_thread ().
Scenario:
- Connect to non-stop remote target
- Thread receives signal (e.g., SIGUSR1) and stops
- Disconnect and reconnect
- "info program" reports "not being run" (FAIL)
---
gdb/remote.c | 1 +
1 file changed, 1 insertion(+)
@@ -5165,6 +5165,7 @@ remote_target::print_one_stopped_thread (thread_info *thread)
/* For "info program". */
set_last_target_status (this, thread->ptid, ws);
+ update_previous_thread ();
if (ws.kind () == TARGET_WAITKIND_STOPPED)
{