gas/
[deliverable/binutils-gdb.git] / gdb / hppa-hpux-nat.c
index 4a5ac1130256eeeb5448fca14349ec0e94d57747..ba2569d3202bc0e264f0fc5691a27fdfe088f0b5 100644 (file)
@@ -1,7 +1,6 @@
 /* Native-dependent code for PA-RISC HP-UX.
 
-   Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 2004-2013 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -25,6 +24,7 @@
 
 #include "gdb_assert.h"
 #include <sys/ptrace.h>
+#include <sys/utsname.h>
 #include <machine/save_state.h>
 
 #ifdef HAVE_TTRACE
@@ -32,6 +32,7 @@
 #endif
 
 #include "hppa-tdep.h"
+#include "solib-som.h"
 #include "inf-ptrace.h"
 #include "inf-ttrace.h"
 
@@ -233,6 +234,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);
+}
+
 \f
 
 /* Prevent warning from -Wmissing-prototypes.  */
@@ -243,6 +259,8 @@ _initialize_hppa_hpux_nat (void)
 {
   struct target_ops *t;
 
+  set_hpux_major_release ();
+
 #ifdef HAVE_TTRACE
   t = inf_ttrace_target ();
 #else
This page took 0.027512 seconds and 4 git commands to generate.