aboutsummaryrefslogtreecommitdiff
path: root/gdb/hppa-hpux-nat.c
diff options
context:
space:
mode:
authorPierre Muller <muller@sourceware.org>2011-01-14 18:39:31 +0000
committerPierre Muller <muller@sourceware.org>2011-01-14 18:39:31 +0000
commit7b64a93b0333a9520ca23d3dcbaa5b6b5eb3d6f0 (patch)
tree5d932a46c1f2a21f04d34c3259f7a06a33169c78 /gdb/hppa-hpux-nat.c
parent4e18c05334a75c03e98ae058cc8e9436a037a957 (diff)
downloadgdb-7b64a93b0333a9520ca23d3dcbaa5b6b5eb3d6f0.zip
gdb-7b64a93b0333a9520ca23d3dcbaa5b6b5eb3d6f0.tar.gz
gdb-7b64a93b0333a9520ca23d3dcbaa5b6b5eb3d6f0.tar.bz2
* 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.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/hppa-hpux-nat.c b/gdb/hppa-hpux-nat.c
index 4a5ac11..7e4c670 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