public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [RFA 5/5] New patches to support --enable-targets=all for mingw64
@ 2010-09-10 15:43 Pierre Muller
  2010-09-13 19:14 ` Joel Brobecker
  0 siblings, 1 reply; 7+ messages in thread
From: Pierre Muller @ 2010-09-10 15:43 UTC (permalink / raw)
  To: gdb-patches

  I tried to compile GDB with
--enable-targets=all for x86_64-w64-mingw32
target.
  As 'long' type is 4-byte while pointer type is 8-byte,
this target is quite sensitive to so 'dirty' code
lying around like casting 'long' or 'unsigned long' to pointers...

  I had to fix several sources to be able to 
successfully compile GDB with those configuration options.

5) solib-som.c is a tdep file (it is listed in ALL_TARGET_OBS)
but it tries to get the hpux system version trough
a direct system call, which probably leads to wrong results
on other systems too.

  If you compile using --enable-targets=all on linux,
the compilation will complete because sys/utsname.h
is available on linux, but if you remote debug a HPUX
program, the current version of get_hpux_major_release
will return a number related to the current Linux system
you are running GDB on... which is totally useless.
  A proper fix would be to get this information via a remote
packet if not native... but I have no access nor time to spend
on that.


Pierre Muller
Pascal language support maintainer for GDB


2010-09-10  Pierre Muller  <muller@ics.u-strasbg.fr>

	* solib-som.c (sys/utsname.h include): Only include on HPUX system.
	(get_hpux_major_release): Return 0 if not on HPUX system.

Index: src/gdb/solib-som.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-som.c,v
retrieving revision 1.29
diff -u -p -r1.29 solib-som.c
--- src/gdb/solib-som.c	16 May 2010 23:49:58 -0000	1.29
+++ src/gdb/solib-som.c	9 Sep 2010 16:39:59 -0000
@@ -32,7 +32,9 @@
 #include "solib.h"
 #include "solib-som.h"
 
+#ifdef __hpux
 #include <sys/utsname.h>
+#endif
 #include <string.h>
 
 #undef SOLIB_SOM_DBG 
@@ -137,7 +139,7 @@ static int
 get_hpux_major_release (void)
 {
   static int hpux_major_release = -1;
-
+#ifdef __hpux
   if (hpux_major_release == -1)
     {
       struct utsname x;
@@ -147,7 +149,9 @@ get_hpux_major_release (void)
       p = strchr (x.release, '.');
       hpux_major_release = p ? atoi (p + 1) : 0;
     }
-
+#else
+  hpux_major_release = 0;
+#endif
   return hpux_major_release;
 }
 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA 5/5] New patches to support --enable-targets=all for mingw64
  2010-09-10 15:43 [RFA 5/5] New patches to support --enable-targets=all for mingw64 Pierre Muller
@ 2010-09-13 19:14 ` Joel Brobecker
  2010-09-14 11:44   ` Pierre Muller
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2010-09-13 19:14 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

> 5) solib-som.c is a tdep file (it is listed in ALL_TARGET_OBS)
> but it tries to get the hpux system version trough
> a direct system call, which probably leads to wrong results
> on other systems too.

Ugh!

I have a more radical suggestion: AFAIK, we have not supported pa-hpux
version 10.x or older for quite a while.  According to HP, the first
11.x release was in 1997, and the l0.x release was also in 1997.

Given that this version number is used to determine whether the OS
version is 11 or more, we can assume that this is always true, and
thus get rid of the function (and the associated include) entirely.

-- 
Joel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [RFA 5/5] New patches to support --enable-targets=all for mingw64
  2010-09-13 19:14 ` Joel Brobecker
@ 2010-09-14 11:44   ` Pierre Muller
  2010-09-14 15:24     ` [RFC] hpux code fix ( was [RFA 5/5] New patches to support --enable-targets=all for mingw64) Pierre Muller
  2010-09-14 19:39     ` [RFA 5/5] New patches to support --enable-targets=all for mingw64 Joel Brobecker
  0 siblings, 2 replies; 7+ messages in thread
From: Pierre Muller @ 2010-09-14 11:44 UTC (permalink / raw)
  To: 'Joel Brobecker'; +Cc: gdb-patches



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Joel Brobecker
> Envoyé : Monday, September 13, 2010 8:11 PM
> À : Pierre Muller
> Cc : gdb-patches@sourceware.org
> Objet : Re: [RFA 5/5] New patches to support --enable-targets=all for
> mingw64
> 
> > 5) solib-som.c is a tdep file (it is listed in ALL_TARGET_OBS)
> > but it tries to get the hpux system version trough
> > a direct system call, which probably leads to wrong results
> > on other systems too.
> 
> Ugh!
> 
> I have a more radical suggestion: AFAIK, we have not supported pa-hpux
> version 10.x or older for quite a while.  According to HP, the first
> 11.x release was in 1997, and the l0.x release was also in 1997.

  I am not against as I have no interest in HPUX in general...
 
> Given that this version number is used to determine whether the OS
> version is 11 or more, we can assume that this is always true, and
> thus get rid of the function (and the associated include) entirely.

  But shouldn't we then clearly state that we drop hpux 10.X versions 
support?
 
  Should we remove the function get_hpux_major_release 
completely, or turn it into a function returning a variable,
that could be set by some command like
"set hpux-major-release-version XX"
that would allow people using it on an old HPUX 10.X
to still get old behavior?

  Does anyone know of a good mailing list for HPUX
developers to which we could forward that question?


Pierre Muller
Pascal language support maintainer for GDB



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [RFC] hpux code fix ( was [RFA 5/5] New patches to support --enable-targets=all for mingw64)
  2010-09-14 11:44   ` Pierre Muller
@ 2010-09-14 15:24     ` Pierre Muller
  2010-09-27 17:34       ` [PING][RFC] " Pierre Muller
  2010-09-14 19:39     ` [RFA 5/5] New patches to support --enable-targets=all for mingw64 Joel Brobecker
  1 sibling, 1 reply; 7+ messages in thread
From: Pierre Muller @ 2010-09-14 15:24 UTC (permalink / raw)
  To: 'Joel Brobecker'; +Cc: gdb-patches

  I finally wrote a patch that moves the
OS specific uname call to hppa-hpux-nat.c
and adds a new set/show command allowing to
override the default hpux_major_release version
(that I set to 11).

  The only trouble is that I have no way to 
test this patch for the native part...
The compilation with --enable-targets=all
works and the tdep parts seem to work as expected.

  Could someone test this out?

  Comments welcome,


Pierre Muller
Pascal language support maintainer for GDB

ChangeLog entry: 

2010-09-14  Pierre Muller  <muller@ics.u-strasbg.fr>

	* solib-som.h (hpux_major_release): Declare new external variable. 
	* hppa-hpux-nat.c: Add sys/utsname.h include.
	(_initialize_hppa_hpux_nat): Set default value of
	hpux_major_release to ouptut of uname call.
	* solib-som.c: Remove HPUX specific code.
	(DEFAULT_HPUX_MAJOR_RELEASE): New macro.
	(hpux_major_release): New global variable.
	(show_hpux_major_release): New function.
	(get_hpux_major_release): Simply return current HPUX_MAJOR_RELEASE.
	(_initialize_som_solib): Add new set/show commands hpux-major-release.


Index: solib-som.h
===================================================================
RCS file: /cvs/src/src/gdb/solib-som.h,v
retrieving revision 1.8
diff -u -p -r1.8 solib-som.h
--- solib-som.h	1 Jan 2010 07:31:41 -0000	1.8
+++ solib-som.h	14 Sep 2010 10:37:04 -0000
@@ -24,6 +24,8 @@ struct objfile;
 struct section_offsets;
 struct gdbarch;
 
+extern int hpux_major_release;
+
 void som_solib_select (struct gdbarch *gdbarch);
 
 int som_solib_section_offsets (struct objfile *objfile,
Index: hppa-hpux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-hpux-nat.c,v
retrieving revision 1.20
diff -u -p -r1.20 hppa-hpux-nat.c
--- hppa-hpux-nat.c	1 Jan 2010 07:31:33 -0000	1.20
+++ hppa-hpux-nat.c	14 Sep 2010 10:37:04 -0000
@@ -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"
 
@@ -254,7 +256,12 @@ void
 _initialize_hppa_hpux_nat (void)
 {
   struct target_ops *t;
+  struct utsname x;
+  char *p;
 
+  uname (&x);
+  p = strchr (x.release, '.');
+  hpux_major_release = p ? atoi (p + 1) : 11;
 #ifdef HAVE_TTRACE
   t = inf_ttrace_target ();
 #else
Index: solib-som.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-som.c,v
retrieving revision 1.29
diff -u -p -r1.29 solib-som.c
--- solib-som.c	16 May 2010 23:49:58 -0000	1.29
+++ solib-som.c	14 Sep 2010 10:37:04 -0000
@@ -26,13 +26,14 @@
 #include "gdbcore.h"
 #include "target.h"
 #include "inferior.h"
+#include "command.h"
+#include "gdbcmd.h"
 
 #include "hppa-tdep.h"
 #include "solist.h"
 #include "solib.h"
 #include "solib-som.h"
 
-#include <sys/utsname.h>
 #include <string.h>
 
 #undef SOLIB_SOM_DBG 
@@ -133,21 +134,22 @@ som_relocate_section_addresses (struct s
 /* Get HP-UX major release number.  Returns zero if the
    release is not known.  */
 
+#define DEFAULT_HPUX_MAJOR_RELEASE 11
+int
+hpux_major_release = DEFAULT_HPUX_MAJOR_RELEASE;
+
+static void
+show_hpux_major_release (struct ui_file *file, int from_tty,
+			  struct cmd_list_element *c, const char *value)
+{
+  fprintf_filtered (file, _("\
+Currently assumed major release version for HPUX is %d.\n"),
+		    hpux_major_release);
+}
+
 static int
 get_hpux_major_release (void)
 {
-  static int hpux_major_release = -1;
-
-  if (hpux_major_release == -1)
-    {
-      struct utsname x;
-      char *p;
-
-      uname (&x);
-      p = strchr (x.release, '.');
-      hpux_major_release = p ? atoi (p + 1) : 0;
-    }
-
   return hpux_major_release;
 }
 
@@ -810,6 +812,13 @@ _initialize_som_solib (void)
   som_so_ops.open_symbol_file_object = som_open_symbol_file_object;
   som_so_ops.in_dynsym_resolve_code = som_in_dynsym_resolve_code;
   som_so_ops.bfd_open = solib_bfd_open;
+  add_setshow_integer_cmd ("hpux-major-release", class_support,
+			   &hpux_major_release, _("\
+Set assumed HPUX major release version."), _("\
+Show assumed HPUX major release version."), NULL,
+			    NULL,
+			    show_hpux_major_release,
+			    &setlist, &showlist);
 }
 
 void

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA 5/5] New patches to support --enable-targets=all for mingw64
  2010-09-14 11:44   ` Pierre Muller
  2010-09-14 15:24     ` [RFC] hpux code fix ( was [RFA 5/5] New patches to support --enable-targets=all for mingw64) Pierre Muller
@ 2010-09-14 19:39     ` Joel Brobecker
  1 sibling, 0 replies; 7+ messages in thread
From: Joel Brobecker @ 2010-09-14 19:39 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

> But shouldn't we then clearly state that we drop hpux 10.X versions
> support?

We can. I don't think this is necessary, but Eli might think differently.
In any case, it doesn't cost much to add a NEWS entry mentioning it.

>   Should we remove the function get_hpux_major_release completely, or
>   turn it into a function returning a variable, that could be set by
>   some command like "set hpux-major-release-version XX" that would
>   allow people using it on an old HPUX 10.X to still get old behavior?

For a platform such as pa-hpux, I would do the strict minimum to make
it work. I think you can just remove the function and assume version
is 11 or higher.

>   Does anyone know of a good mailing list for HPUX developers to which
>   we could forward that question?

It may sound harsh, but I personally think that the input from HP/UX
developers in general is only of moderate interest to us.  As long as
no one steps up to the plate to support version 10.x of pa-hpux, we don't
have the necessary means to do so.  In fact, pa-hpux in general hasn't
received much attention in the last few years.  The only reason why
I haven't discussed its removal is because I am still planning on
contributing support for ia64-hpux, which should share a lot of code
with pa-hpux support.

My suggestion in this case is to KISS. If it turns out that this affects
a developer who wants to upgrade to gdb-7.3, then we can think of
alternative strategies, such as the one you suggested, and have him
test it. Otherwise, the user should just stay with the older version
of GDB.

-- 
Joel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PING][RFC] hpux code fix ( was [RFA 5/5] New patches to support --enable-targets=all for mingw64)
  2010-09-14 15:24     ` [RFC] hpux code fix ( was [RFA 5/5] New patches to support --enable-targets=all for mingw64) Pierre Muller
@ 2010-09-27 17:34       ` Pierre Muller
  2010-09-27 17:43         ` Pedro Alves
  0 siblings, 1 reply; 7+ messages in thread
From: Pierre Muller @ 2010-09-27 17:34 UTC (permalink / raw)
  To: 'Pierre Muller', 'Joel Brobecker'; +Cc: gdb-patches


  Sadly, it seems that no-one is
maintainer of hppa port anymore...

  Joel, could you please still take a short look on this?

Thanks in advance,


Pierre Muller
Pascal language support maintainer for GDB


> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Pierre Muller
> Envoyé : Tuesday, September 14, 2010 1:44 PM
> À : 'Joel Brobecker'
> Cc : gdb-patches@sourceware.org
> Objet : [RFC] hpux code fix ( was [RFA 5/5] New patches to support --
> enable-targets=all for mingw64)
> 
>   I finally wrote a patch that moves the
> OS specific uname call to hppa-hpux-nat.c
> and adds a new set/show command allowing to
> override the default hpux_major_release version
> (that I set to 11).
> 
>   The only trouble is that I have no way to
> test this patch for the native part...
> The compilation with --enable-targets=all
> works and the tdep parts seem to work as expected.
> 
>   Could someone test this out?
> 
>   Comments welcome,
> 
> 
> Pierre Muller
> Pascal language support maintainer for GDB
> 
> ChangeLog entry:
> 
> 2010-09-14  Pierre Muller  <muller@ics.u-strasbg.fr>
> 
> 	* solib-som.h (hpux_major_release): Declare new external
> variable.
> 	* hppa-hpux-nat.c: Add sys/utsname.h include.
> 	(_initialize_hppa_hpux_nat): Set default value of
> 	hpux_major_release to ouptut of uname call.
> 	* solib-som.c: Remove HPUX specific code.
> 	(DEFAULT_HPUX_MAJOR_RELEASE): New macro.
> 	(hpux_major_release): New global variable.
> 	(show_hpux_major_release): New function.
> 	(get_hpux_major_release): Simply return current
> HPUX_MAJOR_RELEASE.
> 	(_initialize_som_solib): Add new set/show commands hpux-major-
> release.
> 
> 
> Index: solib-som.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/solib-som.h,v
> retrieving revision 1.8
> diff -u -p -r1.8 solib-som.h
> --- solib-som.h	1 Jan 2010 07:31:41 -0000	1.8
> +++ solib-som.h	14 Sep 2010 10:37:04 -0000
> @@ -24,6 +24,8 @@ struct objfile;
>  struct section_offsets;
>  struct gdbarch;
> 
> +extern int hpux_major_release;
> +
>  void som_solib_select (struct gdbarch *gdbarch);
> 
>  int som_solib_section_offsets (struct objfile *objfile,
> Index: hppa-hpux-nat.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/hppa-hpux-nat.c,v
> retrieving revision 1.20
> diff -u -p -r1.20 hppa-hpux-nat.c
> --- hppa-hpux-nat.c	1 Jan 2010 07:31:33 -0000	1.20
> +++ hppa-hpux-nat.c	14 Sep 2010 10:37:04 -0000
> @@ -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"
> 
> @@ -254,7 +256,12 @@ void
>  _initialize_hppa_hpux_nat (void)
>  {
>    struct target_ops *t;
> +  struct utsname x;
> +  char *p;
> 
> +  uname (&x);
> +  p = strchr (x.release, '.');
> +  hpux_major_release = p ? atoi (p + 1) : 11;
>  #ifdef HAVE_TTRACE
>    t = inf_ttrace_target ();
>  #else
> Index: solib-som.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/solib-som.c,v
> retrieving revision 1.29
> diff -u -p -r1.29 solib-som.c
> --- solib-som.c	16 May 2010 23:49:58 -0000	1.29
> +++ solib-som.c	14 Sep 2010 10:37:04 -0000
> @@ -26,13 +26,14 @@
>  #include "gdbcore.h"
>  #include "target.h"
>  #include "inferior.h"
> +#include "command.h"
> +#include "gdbcmd.h"
> 
>  #include "hppa-tdep.h"
>  #include "solist.h"
>  #include "solib.h"
>  #include "solib-som.h"
> 
> -#include <sys/utsname.h>
>  #include <string.h>
> 
>  #undef SOLIB_SOM_DBG
> @@ -133,21 +134,22 @@ som_relocate_section_addresses (struct s
>  /* Get HP-UX major release number.  Returns zero if the
>     release is not known.  */
> 
> +#define DEFAULT_HPUX_MAJOR_RELEASE 11
> +int
> +hpux_major_release = DEFAULT_HPUX_MAJOR_RELEASE;
> +
> +static void
> +show_hpux_major_release (struct ui_file *file, int from_tty,
> +			  struct cmd_list_element *c, const char *value)
> +{
> +  fprintf_filtered (file, _("\
> +Currently assumed major release version for HPUX is %d.\n"),
> +		    hpux_major_release);
> +}
> +
>  static int
>  get_hpux_major_release (void)
>  {
> -  static int hpux_major_release = -1;
> -
> -  if (hpux_major_release == -1)
> -    {
> -      struct utsname x;
> -      char *p;
> -
> -      uname (&x);
> -      p = strchr (x.release, '.');
> -      hpux_major_release = p ? atoi (p + 1) : 0;
> -    }
> -
>    return hpux_major_release;
>  }
> 
> @@ -810,6 +812,13 @@ _initialize_som_solib (void)
>    som_so_ops.open_symbol_file_object = som_open_symbol_file_object;
>    som_so_ops.in_dynsym_resolve_code = som_in_dynsym_resolve_code;
>    som_so_ops.bfd_open = solib_bfd_open;
> +  add_setshow_integer_cmd ("hpux-major-release", class_support,
> +			   &hpux_major_release, _("\
> +Set assumed HPUX major release version."), _("\
> +Show assumed HPUX major release version."), NULL,
> +			    NULL,
> +			    show_hpux_major_release,
> +			    &setlist, &showlist);
>  }
> 
>  void


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PING][RFC] hpux code fix ( was [RFA 5/5] New patches to support --enable-targets=all for mingw64)
  2010-09-27 17:34       ` [PING][RFC] " Pierre Muller
@ 2010-09-27 17:43         ` Pedro Alves
  0 siblings, 0 replies; 7+ messages in thread
From: Pedro Alves @ 2010-09-27 17:43 UTC (permalink / raw)
  To: gdb-patches; +Cc: Pierre Muller, 'Joel Brobecker'

On Monday 27 September 2010 08:47:22, Pierre Muller wrote:
> 
>   Sadly, it seems that no-one is
> maintainer of hppa port anymore...
> 
>   Joel, could you please still take a short look on this?

Didn't Joel suggest to simply assume release > 11?
I agree with Joel.  Less code and less knobs is better, most
especially in a non-maintained target...  It's not clear who would
benefit from such new command, given that it's not clear that
people actually use current GDB on old hpux, or that current
gdb even works on hpux and even less clear if it works
on older releases.

-- 
Pedro Alves


> 
> Thanks in advance,
> 
> 
> Pierre Muller
> Pascal language support maintainer for GDB
> 
> 
> > -----Message d'origine-----
> > De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> > owner@sourceware.org] De la part de Pierre Muller
> > Envoyé : Tuesday, September 14, 2010 1:44 PM
> > À : 'Joel Brobecker'
> > Cc : gdb-patches@sourceware.org
> > Objet : [RFC] hpux code fix ( was [RFA 5/5] New patches to support --
> > enable-targets=all for mingw64)
> > 
> >   I finally wrote a patch that moves the
> > OS specific uname call to hppa-hpux-nat.c
> > and adds a new set/show command allowing to
> > override the default hpux_major_release version
> > (that I set to 11).
> > 
> >   The only trouble is that I have no way to
> > test this patch for the native part...
> > The compilation with --enable-targets=all
> > works and the tdep parts seem to work as expected.
> > 
> >   Could someone test this out?
> > 
> >   Comments welcome,
> > 
> > 
> > Pierre Muller
> > Pascal language support maintainer for GDB
> > 
> > ChangeLog entry:
> > 
> > 2010-09-14  Pierre Muller  <muller@ics.u-strasbg.fr>
> > 
> > 	* solib-som.h (hpux_major_release): Declare new external
> > variable.
> > 	* hppa-hpux-nat.c: Add sys/utsname.h include.
> > 	(_initialize_hppa_hpux_nat): Set default value of
> > 	hpux_major_release to ouptut of uname call.
> > 	* solib-som.c: Remove HPUX specific code.
> > 	(DEFAULT_HPUX_MAJOR_RELEASE): New macro.
> > 	(hpux_major_release): New global variable.
> > 	(show_hpux_major_release): New function.
> > 	(get_hpux_major_release): Simply return current
> > HPUX_MAJOR_RELEASE.
> > 	(_initialize_som_solib): Add new set/show commands hpux-major-
> > release.
> > 
> > 
> > Index: solib-som.h
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/solib-som.h,v
> > retrieving revision 1.8
> > diff -u -p -r1.8 solib-som.h
> > --- solib-som.h	1 Jan 2010 07:31:41 -0000	1.8
> > +++ solib-som.h	14 Sep 2010 10:37:04 -0000
> > @@ -24,6 +24,8 @@ struct objfile;
> >  struct section_offsets;
> >  struct gdbarch;
> > 
> > +extern int hpux_major_release;
> > +
> >  void som_solib_select (struct gdbarch *gdbarch);
> > 
> >  int som_solib_section_offsets (struct objfile *objfile,
> > Index: hppa-hpux-nat.c
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/hppa-hpux-nat.c,v
> > retrieving revision 1.20
> > diff -u -p -r1.20 hppa-hpux-nat.c
> > --- hppa-hpux-nat.c	1 Jan 2010 07:31:33 -0000	1.20
> > +++ hppa-hpux-nat.c	14 Sep 2010 10:37:04 -0000
> > @@ -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"
> > 
> > @@ -254,7 +256,12 @@ void
> >  _initialize_hppa_hpux_nat (void)
> >  {
> >    struct target_ops *t;
> > +  struct utsname x;
> > +  char *p;
> > 
> > +  uname (&x);
> > +  p = strchr (x.release, '.');
> > +  hpux_major_release = p ? atoi (p + 1) : 11;
> >  #ifdef HAVE_TTRACE
> >    t = inf_ttrace_target ();
> >  #else
> > Index: solib-som.c
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/solib-som.c,v
> > retrieving revision 1.29
> > diff -u -p -r1.29 solib-som.c
> > --- solib-som.c	16 May 2010 23:49:58 -0000	1.29
> > +++ solib-som.c	14 Sep 2010 10:37:04 -0000
> > @@ -26,13 +26,14 @@
> >  #include "gdbcore.h"
> >  #include "target.h"
> >  #include "inferior.h"
> > +#include "command.h"
> > +#include "gdbcmd.h"
> > 
> >  #include "hppa-tdep.h"
> >  #include "solist.h"
> >  #include "solib.h"
> >  #include "solib-som.h"
> > 
> > -#include <sys/utsname.h>
> >  #include <string.h>
> > 
> >  #undef SOLIB_SOM_DBG
> > @@ -133,21 +134,22 @@ som_relocate_section_addresses (struct s
> >  /* Get HP-UX major release number.  Returns zero if the
> >     release is not known.  */
> > 
> > +#define DEFAULT_HPUX_MAJOR_RELEASE 11
> > +int
> > +hpux_major_release = DEFAULT_HPUX_MAJOR_RELEASE;
> > +
> > +static void
> > +show_hpux_major_release (struct ui_file *file, int from_tty,
> > +			  struct cmd_list_element *c, const char *value)
> > +{
> > +  fprintf_filtered (file, _("\
> > +Currently assumed major release version for HPUX is %d.\n"),
> > +		    hpux_major_release);
> > +}
> > +
> >  static int
> >  get_hpux_major_release (void)
> >  {
> > -  static int hpux_major_release = -1;
> > -
> > -  if (hpux_major_release == -1)
> > -    {
> > -      struct utsname x;
> > -      char *p;
> > -
> > -      uname (&x);
> > -      p = strchr (x.release, '.');
> > -      hpux_major_release = p ? atoi (p + 1) : 0;
> > -    }
> > -
> >    return hpux_major_release;
> >  }
> > 
> > @@ -810,6 +812,13 @@ _initialize_som_solib (void)
> >    som_so_ops.open_symbol_file_object = som_open_symbol_file_object;
> >    som_so_ops.in_dynsym_resolve_code = som_in_dynsym_resolve_code;
> >    som_so_ops.bfd_open = solib_bfd_open;
> > +  add_setshow_integer_cmd ("hpux-major-release", class_support,
> > +			   &hpux_major_release, _("\
> > +Set assumed HPUX major release version."), _("\
> > +Show assumed HPUX major release version."), NULL,
> > +			    NULL,
> > +			    show_hpux_major_release,
> > +			    &setlist, &showlist);
> >  }
> > 
> >  void
> 
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-09-27  9:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-10 15:43 [RFA 5/5] New patches to support --enable-targets=all for mingw64 Pierre Muller
2010-09-13 19:14 ` Joel Brobecker
2010-09-14 11:44   ` Pierre Muller
2010-09-14 15:24     ` [RFC] hpux code fix ( was [RFA 5/5] New patches to support --enable-targets=all for mingw64) Pierre Muller
2010-09-27 17:34       ` [PING][RFC] " Pierre Muller
2010-09-27 17:43         ` Pedro Alves
2010-09-14 19:39     ` [RFA 5/5] New patches to support --enable-targets=all for mingw64 Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).