From da7d81e3861d91b055a4bc75a5d1372f0c025e36 Mon Sep 17 00:00:00 2001 From: "Nathan J. Williams" Date: Sat, 7 Aug 2004 21:52:15 +0000 Subject: [PATCH] * configure.in: Test for struct lwp in * bsd-kvm.c (bsd_kvm_proc_cmd): If HAVE_STRUCT_LWP is defined, use the offset of l_addr in struct lwp. --- gdb/ChangeLog | 6 ++++++ gdb/bsd-kvm.c | 4 ++++ gdb/configure.in | 10 ++++++++++ 3 files changed, 20 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a19c0a70790..b20391a9fee 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2004-08-07 Nathan J. Williams + + * configure.in: Test for struct lwp in . + * bsd-kvm.c (bsd_kvm_proc_cmd): If HAVE_STRUCT_LWP is defined, use + the offset of l_addr in struct lwp. + 2004-08-07 Nathan J. Williams * bsd-kvm.c: Include "gdbcore.h" diff --git a/gdb/bsd-kvm.c b/gdb/bsd-kvm.c index 45ce5619516..083bc92c297 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)); diff --git a/gdb/configure.in b/gdb/configure.in index 2a2714ba098..6eac7612f8c 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -553,6 +553,16 @@ if test $gdb_cv_struct_thread_td_pcb = yes; then [Define to 1 if your system has td_pcb in struct thread.]) fi +# See if defines `struct lwp`. +AC_CACHE_CHECK([for struct lwp], gdb_cv_struct_lwp, +[AC_TRY_COMPILE([#include +#include ], [struct lwp l;], +gdb_cv_struct_lwp=yes, gdb_cv_struct_lwp=no)]) +if test $gdb_cv_struct_lwp = yes; then + AC_DEFINE(HAVE_STRUCT_LWP, 1, + [Define to 1 if your system has struct lwp.]) +fi + # See if degines `struct reg'. AC_CACHE_CHECK([for struct reg in machine/reg.h], gdb_cv_struct_reg, [AC_TRY_COMPILE([#include -- 2.30.2