aboutsummaryrefslogtreecommitdiff
path: root/gdb/bsd-kvm.c
diff options
context:
space:
mode:
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));