This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] More hppa-hpux cross-build fixes


Hello,

hppa-hpux-tdep.c still doesn't build on any non-HPUX machine as it
- includes native header files
- uses a symbol (TYPE_PROCEDURE) defined there

As the TYPE_PROCEDURE value cannot really change (it's part of the ABI),
I'd suggest to simply replace it with its numerical value.  Joel has
found that value to be 3.  Thanks, Joel!

The following patch makes hppa-hpux-tdep.c build on Linux.
(Of course you still cannot build a full cross-GDB to hppa-hpux
since e.g. somread.c doesn't compile.  But at least it helps
verify changes to the -tdep.c file don't introduce compiler
errors ...)

Committed to mainline.

Bye,
Ulrich


ChangeLog:

	* hppa-hpux-tdep.c: Do not include <dl.h> or <machine/save_state.h>.
	(offsetof): Do not define.
	(find_stub_with_shl_get): Use numerical value 3 instead of
	symbolic value TYPE_PROCEDURE.

Index: gdb/hppa-hpux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-hpux-tdep.c,v
retrieving revision 1.55
diff -u -p -r1.55 hppa-hpux-tdep.c
--- gdb/hppa-hpux-tdep.c	13 May 2007 13:02:54 -0000	1.55
+++ gdb/hppa-hpux-tdep.c	14 May 2007 21:25:05 -0000
@@ -40,13 +40,6 @@
 
 #include "gdb_string.h"
 
-#include <dl.h>
-#include <machine/save_state.h>
-
-#ifndef offsetof
-#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
-#endif
-
 #define IS_32BIT_TARGET(_gdbarch) \
 	((gdbarch_tdep (_gdbarch))->bytes_per_address == 4)
 
@@ -721,7 +714,7 @@ find_stub_with_shl_get (struct minimal_s
   args[0] = value_from_longest (TYPE_FIELD_TYPE (ftype, 0), 12);
   args[1] = value_from_pointer (TYPE_FIELD_TYPE (ftype, 1), SYMBOL_VALUE_ADDRESS (msymbol));
   args[2] = value_from_pointer (TYPE_FIELD_TYPE (ftype, 2), endo_buff_addr);
-  args[3] = value_from_longest (TYPE_FIELD_TYPE (ftype, 3), TYPE_PROCEDURE);
+  args[3] = value_from_longest (TYPE_FIELD_TYPE (ftype, 3), 3 /* TYPE_PROCEDURE */);
   args[4] = value_from_pointer (TYPE_FIELD_TYPE (ftype, 4), value_return_addr);
   args[5] = value_from_pointer (TYPE_FIELD_TYPE (ftype, 5), errno_return_addr);
 
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]