From 654348f5c99e8119e538c96fd974dfab2eaf4e8a Mon Sep 17 00:00:00 2001 From: Pierre Muller Date: Fri, 14 Jan 2011 18:39:31 +0000 Subject: * solib-som.h (hpux_major_release): Declare variable here. * solib-som.c: Remove 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 include. Add "solib-som.h" header. (set_hpux_major_release): New function. (_initialize_hppa_hpux_nat): Call set_hpux_major_release. --- gdb/hppa-hpux-nat.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gdb/hppa-hpux-nat.c') 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 +#include #include #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 -- cgit v1.2.1