diff options
author | Pierre Muller <muller@ics.u-strasbg.fr> | 2011-01-14 18:39:31 +0000 |
---|---|---|
committer | Pierre Muller <muller@ics.u-strasbg.fr> | 2011-01-14 18:39:31 +0000 |
commit | 654348f5c99e8119e538c96fd974dfab2eaf4e8a (patch) | |
tree | 694128cf54f9a62aaa997052c783fb5bb334a081 /gdb/hppa-hpux-nat.c | |
parent | b439e77336d08eb7a64a7c760d9775770b3d4d9a (diff) | |
download | gdb-654348f5c99e8119e538c96fd974dfab2eaf4e8a.tar.gz |
* solib-som.h (hpux_major_release): Declare variable here.
* solib-som.c: Remove <sys/utsname.h> header.
(DEFAULT_HPUX_MAJOR_RELEASE): New macro.
(hpux_major_release): Make global, change default value to
DEFAULT_HPUX_MAJOR_RELEASE.
(get_hpux_major_release): Simply return HPUX_MAJOR_RELEASE.
* hppa-hpux-nat.c: Add <sys/utsname.h> include.
Add "solib-som.h" header.
(set_hpux_major_release): New function.
(_initialize_hppa_hpux_nat): Call set_hpux_major_release.
Diffstat (limited to 'gdb/hppa-hpux-nat.c')
-rw-r--r-- | gdb/hppa-hpux-nat.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/hppa-hpux-nat.c b/gdb/hppa-hpux-nat.c index 4a5ac113025..7e4c670e8f3 100644 --- a/gdb/hppa-hpux-nat.c +++ b/gdb/hppa-hpux-nat.c @@ -25,6 +25,7 @@ #include "gdb_assert.h" #include <sys/ptrace.h> +#include <sys/utsname.h> #include <machine/save_state.h> #ifdef HAVE_TTRACE @@ -32,6 +33,7 @@ #endif #include "hppa-tdep.h" +#include "solib-som.h" #include "inf-ptrace.h" #include "inf-ttrace.h" @@ -233,6 +235,21 @@ hppa_hpux_store_inferior_registers (struct target_ops *ops, hppa_hpux_store_register (regcache, regnum); } +/* Set hpux_major_release variable to the value retrieved from a call to + uname function. */ + +static void +set_hpux_major_release (void) +{ + struct utsname x; + char *p; + + uname (&x); + p = strchr (x.release, '.'); + if (p) + hpux_major_release = atoi (p + 1); +} + /* Prevent warning from -Wmissing-prototypes. */ @@ -243,6 +260,8 @@ _initialize_hppa_hpux_nat (void) { struct target_ops *t; + set_hpux_major_release (); + #ifdef HAVE_TTRACE t = inf_ttrace_target (); #else |