aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2004-06-27 15:56:20 +0000
committerMark Kettenis <kettenis@gnu.org>2004-06-27 15:56:20 +0000
commitefe1d7b9b08b07cb56e7747fe326235060841b2e (patch)
treef5c8a92ee0e0dfe00935d94789acd3c89ae6cb1a
parent315c4276b17212eb4851c918de7f38d9d155c25f (diff)
downloadgdb-efe1d7b9b08b07cb56e7747fe326235060841b2e.zip
gdb-efe1d7b9b08b07cb56e7747fe326235060841b2e.tar.gz
gdb-efe1d7b9b08b07cb56e7747fe326235060841b2e.tar.bz2
* bsd-kvm.c (bsd_kvm_fetch_registers): Directly return after
fetching from BSD_KVM_PADDR. Correctly lookup address for "_thread0".
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/bsd-kvm.c9
2 files changed, 10 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1889112..6df260c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2004-06-27 Mark Kettenis <kettenis@gnu.org>
+ * bsd-kvm.c (bsd_kvm_fetch_registers): Directly return after
+ fetching from BSD_KVM_PADDR. Correctly lookup address for
+ "_thread0".
+
* amd64fbsd-nat.c: Include <sys/types.h, <machine/pcb.h> and
"bsd-kvm.h".
(amd64fbsd_supply_pcb): New funcion.
diff --git a/gdb/bsd-kvm.c b/gdb/bsd-kvm.c
index 37fc2b4..a037f84 100644
--- a/gdb/bsd-kvm.c
+++ b/gdb/bsd-kvm.c
@@ -128,7 +128,10 @@ bsd_kvm_fetch_registers (int regnum)
struct nlist nl[2];
if (bsd_kvm_paddr)
- bsd_kvm_fetch_pcb (bsd_kvm_paddr);
+ {
+ bsd_kvm_fetch_pcb (bsd_kvm_paddr);
+ return;
+ }
/* On dumping core, BSD kernels store the faulting context (PCB)
in the variable "dumppcb". */
@@ -185,8 +188,8 @@ bsd_kvm_fetch_registers (int regnum)
struct pcb *paddr;
/* Found thread0. */
- nl[1].n_value += offsetof (struct thread, td_pcb);
- if (kvm_read (core_kd, nl[1].n_value, &paddr, sizeof paddr) == -1)
+ nl[0].n_value += offsetof (struct thread, td_pcb);
+ if (kvm_read (core_kd, nl[0].n_value, &paddr, sizeof paddr) == -1)
error ("%s", kvm_geterr (core_kd));
bsd_kvm_fetch_pcb (paddr);