aboutsummaryrefslogtreecommitdiff
path: root/gdb/bsd-kvm.c
diff options
context:
space:
mode:
authorNathan J. Williams <nathanw@wasabisystems.com>2004-08-07 21:52:15 +0000
committerNathan J. Williams <nathanw@wasabisystems.com>2004-08-07 21:52:15 +0000
commitda7d81e3861d91b055a4bc75a5d1372f0c025e36 (patch)
tree42e97b64580bd9db9af356592a54b0cf4ddc943a /gdb/bsd-kvm.c
parent7f245d65f70913f51bfd1cb4f49822801ca6ecc9 (diff)
downloadgdb-da7d81e3861d91b055a4bc75a5d1372f0c025e36.zip
gdb-da7d81e3861d91b055a4bc75a5d1372f0c025e36.tar.gz
gdb-da7d81e3861d91b055a4bc75a5d1372f0c025e36.tar.bz2
* configure.in: Test for struct lwp in <sys/lwp.h>
* bsd-kvm.c (bsd_kvm_proc_cmd): If HAVE_STRUCT_LWP is defined, use the offset of l_addr in struct lwp.
Diffstat (limited to 'gdb/bsd-kvm.c')
-rw-r--r--gdb/bsd-kvm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/bsd-kvm.c b/gdb/bsd-kvm.c
index 45ce561..083bc92 100644
--- a/gdb/bsd-kvm.c
+++ b/gdb/bsd-kvm.c
@@ -230,7 +230,11 @@ bsd_kvm_proc_cmd (char *arg, int fromtty)
error ("No kernel memory image.");
addr = parse_and_eval_address (arg);
+#ifdef HAVE_STRUCT_LWP
+ addr += offsetof (struct lwp, l_addr);
+#else
addr += offsetof (struct proc, p_addr);
+#endif
if (kvm_read (core_kd, addr, &bsd_kvm_paddr, sizeof bsd_kvm_paddr) == -1)
error ("%s", kvm_geterr (core_kd));