Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit 5c512f6

Browse files
committed
gdb_main: Modify halt-responses to report thread p1.1 not 1 (regression since v1.10.0-1548-g 1a9fc96)
* GDB 10 through 12 works fine with T05 but generates bogus inferior 2 with T05thread:1; * This form (T05thread:p1.1;) seems to fix that but it breaks again with run/vKill-packet (even for GDB-13 and newer)
1 parent 24e36ec commit 5c512f6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/gdb_main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ static void exec_v_attach(const char *const packet, const size_t length)
688688
* https://sourceware.org/pipermail/gdb-patches/2022-April/188058.html
689689
* https://sourceware.org/pipermail/gdb-patches/2022-July/190869.html
690690
*/
691-
gdb_putpacket_str_f("T%02Xthread:1;", GDB_SIGTRAP);
691+
gdb_putpacket_str_f("T%02Xthread:p1.1;", GDB_SIGTRAP);
692692
} else
693693
gdb_put_packet_error(1U);
694694

@@ -981,16 +981,16 @@ void gdb_poll_target(void)
981981
morse("TARGET LOST.", true);
982982
break;
983983
case TARGET_HALT_REQUEST:
984-
gdb_putpacket_str_f("T%02Xthread:1;", GDB_SIGINT);
984+
gdb_putpacket_str_f("T%02Xthread:p1.1;", GDB_SIGINT);
985985
break;
986986
case TARGET_HALT_WATCHPOINT:
987987
gdb_putpacket_str_f(
988988
"T%02Xwatch:%0" PRIX32 "%08" PRIX32 ";", GDB_SIGTRAP, (uint32_t)(watch >> 32U), (uint32_t)watch);
989989
break;
990990
case TARGET_HALT_FAULT:
991-
gdb_putpacket_str_f("T%02Xthread:1;", GDB_SIGSEGV);
991+
gdb_putpacket_str_f("T%02Xthread:p1.1;", GDB_SIGSEGV);
992992
break;
993993
default:
994-
gdb_putpacket_str_f("T%02Xthread:1;", GDB_SIGTRAP);
994+
gdb_putpacket_str_f("T%02Xthread:p1.1;", GDB_SIGTRAP);
995995
}
996996
}

0 commit comments

Comments
 (0)