bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gdb/hpux-threads on HPPA


From: H.Merijn Brand
Subject: gdb/hpux-threads on HPPA
Date: Wed, 15 Jun 2005 18:07:03 +0200

I finally took the time to make gdb-6.3 compile on HP-UX 11.00

This is probably not the way *you* might prefer the patch to be applied, but
without it, it won't compile

=======================================================================
HP-UX 11.00 with gcc-4.0.0/32

--8<---
--- gdb/hpux-thread.c.org       2005-06-15 16:49:37 +0200
+++ gdb/hpux-thread.c   2005-06-15 16:56:30 +0200
@@ -47,6 +47,16 @@
 #include "gdb_stat.h"
 #include "gdbcore.h"

+#include "hppa-tdep.h"
+#undef NUM_REGS                        /* gcc cannot cope with a function call 
here */
+extern void *memset (void *, int, size_t);
+#ifdef GDB_TARGET_IS_HPPA_20W  /* hppa64 */
+#define NUM_REGS 96
+#else                          /* hppa32 */
+#define NUM_REGS 128
+#endif
+#define FLAGS_REGNUM HPPA_FLAGS_REGNUM
+
 extern int child_suppress_run;

 extern void _initialize_hpux_thread (void);
@@ -286,7 +296,7 @@ hpux_thread_fetch_registers (int regno)
        deprecated_child_ops.to_fetch_registers (regno);
       else
        {
-         unsigned char buf[MAX_REGISTER_SIZE];
+         char buf[MAX_REGISTER_SIZE];
          CORE_ADDR sp;

          sp = (CORE_ADDR) tcb_ptr->static_ctx.sp - 160;
-->8---
One warning left:

gcc -B/usr/local/pa20_32/bin -c -mpa-risc-2-0 -g -O2   -Dvfork=fork  -I. -I. 
-I./config -DLOCALEDIR="\"/usr/local/pa20_32/share/locale\"" -DHAVE_CONFIG_H 
-I./../include/opcode -I./../readline/.. -I../bfd -I./../bfd -I./../include 
-I../intl -I./../intl  -DMI_OUT=1 -DTUI=1 -Wimplicit -Wreturn-type -Wcomment 
-Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized 
-Wformat-nonliteral -Wunused-label -Wunused-function  -I./osf-share \
        -I./osf-share/HP800 -I/usr/include/dce \
        ./hpux-thread.c
./hpux-thread.c: In function 'hpux_thread_store_registers':
./hpux-thread.c:375: warning: cast to pointer from integer of different size

=======================================================================
HP-UX 11.00 with gcc-4.0.0/64

I happen to have a ncurses 64bit lib that gdb finds, but does not like:

gcc64 -B/usr/local/pa20_64/bin -mpa-risc-2-0 -g -O2   -Dvfork=fork     \
        -o gdb gdb.o libgdb.a \
           ../bfd/libbfd.a ../readline/libreadline.a ../opcodes/libopcodes.a  
../libiberty/libiberty.a     -lncurses -lm  ../libiberty/libiberty.a
libgdb.a(hppa-hpux-tdep.o): In function `hppa_hpux_som_find_global_pointer':
: undefined reference to `som_solib_get_got_by_pc'
libgdb.a(tui-io.o): In function `tui_puts':
: undefined reference to `__getcury'
libgdb.a(tui-winsource.o): In function `tui_show_source_line':
: undefined reference to `__getcury'
collect2: ld returned 1 exit status

When run by hand with -lcurses, I get 

a5:/pro/3gl/GNU/gdb-6.3/gdb 160 > gcc64 -B/usr/local/pa20_64/bin -mpa-risc-2-0 
-g -O2   -Dvfork=fork -o gdb gdb.o libgdb.a ../bfd/libbfd.a 
../readline/libreadline.a ../opcodes/libopcodes.a  ../libiberty/libiberty.a     
-lcurses -lm  ../libiberty/libiberty.a
libgdb.a(hppa-hpux-tdep.o): In function `hppa_hpux_som_find_global_pointer':
: undefined reference to `som_solib_get_got_by_pc'
collect2: ld returned 1 exit status

I had to add

--8<---
CORE_ADDR
som_solib_get_got_by_pc (CORE_ADDR addr)
{
  return (pa64_solib_get_got_by_pc (addr));
}
-->8---

to pa64solib.c

a5:/pro/3gl/GNU/gdb-6.3/gdb 190 > gcc64 -B/usr/local/pa20_64/bin -mpa-risc-2-0 
-g -O2 -Dvfork=fork -o gdb gdb.o libgdb.a ../bfd/libbfd.a 
../readline/libreadline.a ../opcodes/libopcodes.a ../libiberty/libiberty.a 
-lcurses -lm ../libiberty/libiberty.a
a5:/pro/3gl/GNU/gdb-6.3/gdb 191 >

:) :)



-- 
H.Merijn Brand        Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using Perl 5.6.2, 5.8.0, 5.8.5, & 5.9.2  on HP-UX 10.20, 11.00 & 11.11,
 AIX 4.3 & 5.2, SuSE 9.2 & 9.3, and Cygwin. http://www.cmve.net/~merijn
Smoking perl: http://www.test-smoke.org,    perl QA: http://qa.perl.org
 reports  to: address@hidden,                address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]