mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-09 04:15:52 +00:00
parent
f0b734886e
commit
3cb567d0b1
@ -1 +1 @@
|
||||
a8c8d04deda7e71e478139c13462d27372f61df3
|
||||
e87f5f493b158db5eef0add1064352076a2143bf
|
||||
|
41
repos/ports/src/noux-pkg/gdb/patches/first_inferior.patch
Normal file
41
repos/ports/src/noux-pkg/gdb/patches/first_inferior.patch
Normal file
@ -0,0 +1,41 @@
|
||||
first_inferior.patch
|
||||
|
||||
Detect the creation of the first inferior if it doesn't exist yet
|
||||
when GDB connects to the debug monitor and make sure that its pid
|
||||
is sent in 'Hg' commands even if no thread is selected, to get
|
||||
the memory map of the correct inferior with the 'info mem'
|
||||
command.
|
||||
|
||||
diff --git a/gdb/remote.c b/gdb/remote.c
|
||||
index b5db0c0..f36d4a9 100644
|
||||
--- a/gdb/remote.c
|
||||
+++ b/gdb/remote.c
|
||||
@@ -2908,6 +2908,9 @@ remote_target::set_thread (ptid_t ptid, int gen)
|
||||
xsnprintf (buf, endbuf - buf, "0");
|
||||
else if (ptid == minus_one_ptid)
|
||||
xsnprintf (buf, endbuf - buf, "-1");
|
||||
+ else if (ptid == null_ptid)
|
||||
+ write_ptid (buf, endbuf, ptid_t (current_inferior()->pid,
|
||||
+ ptid.lwp(), ptid.tid()));
|
||||
else
|
||||
write_ptid (buf, endbuf, ptid);
|
||||
putpkt (rs->buf);
|
||||
@@ -5007,9 +5010,16 @@ remote_target::start_remote_1 (int from_tty, int extended_p)
|
||||
|
||||
if (thread_count (this) == 0)
|
||||
{
|
||||
- if (!extended_p)
|
||||
+ if (!extended_p) {
|
||||
error (_("The target is not running (try extended-remote?)"));
|
||||
- return false;
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ /* Accept remote events to be able to detect the first thread. */
|
||||
+ if (target_can_async_p ())
|
||||
+ target_async (true);
|
||||
+
|
||||
+ return true;
|
||||
}
|
||||
|
||||
/* Report all signals during attach/startup. */
|
@ -7,3 +7,4 @@ gdbserver_genode.patch
|
||||
call_dummy_location.patch
|
||||
non_stop.patch
|
||||
memory_map.patch
|
||||
first_inferior.patch
|
||||
|
Loading…
x
Reference in New Issue
Block a user