This is the mail archive of the gdb-testers@sourceware.cygnus.com 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]

Re: Preparing for the GDB 5.0 / GDB 2000 / GDB2k release


Jeffrey A Law <law@cygnus.com> writes:
>> I don't know what architecture H.J. is using, but I can tell you that
>> shared lib debugging is completely nonfunctional on HPPA (HPUX 10.20).
>> Can't even get a backtrace when execution is stopped in a shlib...

> Testcases please?  If it's busted, it's news to me.  This stuff was rock
> solid when I stopped working on the PA port regularly a few years ago.

OK, the case that's really biting my rear at the moment is that I can't
get a backtrace from a corefile that has committed harakiri via abort().
I'm using gcc-2.95.2 and binutils-2.9.1:

$ cat die.c
#include <stdlib.h>

int main(int argc, char* argv)
{
  abort();
  return 0;
}

$ gcc -v -g -O2 die.c
Reading specs from /usr/local/lib/gcc-lib/hppa2.0-hp-hpux10.20/2.95.2/specs
gcc version 2.95.2 19991024 (release)
 /usr/local/lib/gcc-lib/hppa2.0-hp-hpux10.20/2.95.2/cpp -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=95 -Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -D__hppa__ -D__hp9000s800__ -D__hp9000s800 -D__hp9k8__ -D__PWB__ -D__hpux__ -D__unix__ -D__hppa -D__hp9000s800 -D__hp9k8 -D__PWB -D__hpux -D__unix -Asystem(unix) -Asystem(hpux) -Acpu(hppa) -Amachine(hppa) -D__OPTIMIZE__ -g -D__hp9000s700 -D_PA_RISC1_1 -D_HPUX_SOURCE -D_HIUX_SOURCE -D__STDC_EXT__ die.c /var/tmp/ccOM2dGl.i
GNU CPP version 2.95.2 19991024 (release) (hppa)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/local/lib/gcc-lib/hppa2.0-hp-hpux10.20/2.95.2/../../../../hppa2.0-hp-hpux10.20/include
 /usr/local/lib/gcc-lib/hppa2.0-hp-hpux10.20/2.95.2/include
 /usr/include
End of search list.
The following default directories have been omitted from the search path:
 /usr/local/lib/gcc-lib/hppa2.0-hp-hpux10.20/2.95.2/../../../../include/g++-3
End of omitted list.
 /usr/local/lib/gcc-lib/hppa2.0-hp-hpux10.20/2.95.2/cc1 /var/tmp/ccOM2dGl.i -quiet -dumpbase die.c -g -O2 -version -o /var/tmp/ccWcvHuE.s
GNU C version 2.95.2 19991024 (release) (hppa2.0-hp-hpux10.20) compiled by GNU C version 2.95.2 19991024 (release).
 /usr/local/hppa2.0-hp-hpux10.20/bin/as -o /var/tmp/ccC0G25b.o /var/tmp/ccWcvHuE.s /usr/local/lib/gcc-lib/hppa2.0-hp-hpux10.20/2.95.2/collect2 -L/lib/pa1.1 -L/usr/lib/pa1.1 -z -u main /usr/ccs/lib/crt0.o -L/usr/local/lib/gcc-lib/hppa2.0-hp-hpux10.20/2.95.2 -L/usr/ccs/bin -L/usr/ccs/lib -L/usr/local/lib /var/tmp/ccC0G25b.o -lgcc -lc -lgcc

$ ./a.out
Abort(coredump)

$ gdb a.out core
GNU gdb 20000117
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "hppa2.0-hp-hpux10.20"...
Core was generated by `a.out'.
Program terminated with signal 6, Aborted.

warning: The shared libraries were not privately mapped; setting a
breakpoint in a shared library will not work until you rerun the program.

Reading symbols from a.out...done.
Reading symbols from /usr/lib/libc.1...done.
Reading symbols from /usr/lib/libdld.1...done.
#0  0xc0141120 in ?? () from /usr/lib/libc.1
(gdb) bt
#0  0xc0141120 in ?? () from /usr/lib/libc.1
#1  0xc00aa744 in ?? () from /usr/lib/libc.1
#2  0xc008c258 in ?? () from /usr/lib/libc.1
#3  0xc0086c84 in ?? () from /usr/lib/libc.1
Cannot access memory at address 0x0
(gdb)


If I compile without either -O2 or -O, I get

(gdb) bt
#0  0xc0141120 in ?? () from /usr/lib/libc.1
#1  0xc00aa744 in ?? () from /usr/lib/libc.1
#2  0xc008c258 in ?? () from /usr/lib/libc.1
#3  0xc0086c84 in ?? () from /usr/lib/libc.1
#4  0x2270 in main (argc=1, argv=0x7b03a5a0 "{\003 ") at die.c:5
#5  0xc00656bc in ?? () from /usr/lib/libc.1
(gdb) f 4
#4  0x2270 in main (argc=1, argv=0x7b03a5a0 "{\003 ") at die.c:5
5         abort();
(gdb)

which is still not very helpful as far as the shlib goes, but at least
I can find out where the heck the abort is.  In any case, I thought
gdb claimed to be able to debug optimized code.

I'm running a fairly recent patchlevel of libc, HP's ld, dld, etc.
If you need an exact patch set list, or any other info, let me know.

			regards, tom lane

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