diff options
| author | Peter Edwards <peadar@FreeBSD.org> | 2005-01-21 14:12:11 +0000 |
|---|---|---|
| committer | Peter Edwards <peadar@FreeBSD.org> | 2005-01-21 14:12:11 +0000 |
| commit | 559bcde6c8d61780c6da1e42a6bd740bd6326cf3 (patch) | |
| tree | c624d3b842bb3cac5e99f222caf3c6be2a48d73c /gnu | |
| parent | 341244a87dab15a6cf04ca5586b4e40db65d6724 (diff) | |
Notes
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/usr.bin/gdb/libgdb/fbsd-threads.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gnu/usr.bin/gdb/libgdb/fbsd-threads.c b/gnu/usr.bin/gdb/libgdb/fbsd-threads.c index 93e019b96776..64e8db77d62d 100644 --- a/gnu/usr.bin/gdb/libgdb/fbsd-threads.c +++ b/gnu/usr.bin/gdb/libgdb/fbsd-threads.c @@ -294,8 +294,8 @@ get_current_thread () if (!in_thread_list (ptid)) { add_thread (ptid); - inferior_ptid = ptid; } + inferior_ptid = ptid; } static void @@ -602,7 +602,8 @@ fbsd_lwp_fetch_registers (int regno) return; } - lwp = GET_LWP (inferior_ptid); + /* XXX: We've replaced the pid with the lwpid for GDB's benefit. */ + lwp = GET_PID (inferior_ptid); if (ptrace (PT_GETREGS, lwp, (caddr_t) &gregs, 0) == -1) error ("Cannot get lwp %d registers: %s\n", lwp, safe_strerror (errno)); @@ -1271,7 +1272,10 @@ ps_lgetregs (struct ps_prochandle *ph, lwpid_t lwpid, prgregset_t gregset) struct cleanup *old_chain; old_chain = save_inferior_ptid (); - inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid)); + + /* XXX: Target operation isn't lwp aware: replace pid with lwp */ + inferior_ptid = BUILD_LWP (0, lwpid); + target_fetch_registers (-1); fill_gregset (gregset, -1); do_cleanups (old_chain); |
