GDB 6.8 on sparc64-linux not working, idem on powerpc64-linux

Laurent GUERBY laurent@guerby.net
Sat Feb 28 12:37:00 GMT 2009


FYI the issue looks similar on powerpc64-linux (gcc40 machine on the
compile farm).

Laurent

guerby@gcc40:~/tmp$ cat toto.c
int main(void) { return 0;}
guerby@gcc40:~/tmp$ gcc -m64 -g toto.c
guerby@gcc40:~/tmp$ file ./a.out 
./a.out: ELF 64-bit MSB executable, PowerPC 64-bit or cisco 7500, version 1 (SYSV), for GNU/Linux 2.6.0, dynamically linked (uses shared libs), for GNU/Linux 2.6.0, not stripped    
guerby@gcc40:~/tmp$ /opt/cfarm/gdb-6.8-64/bin/powerpc64-linux-gnu-gdb ./a.out
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=powerpc64-unknown-linux-gnu --target=powerpc64-linux-gnu"...
(gdb) b main
Breakpoint 1 at 0x1000044c: file toto.c, line 1.
(gdb) r
Starting program: /home/guerby/tmp/a.out 
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x100000

Program received signal SIGTRAP, Trace/breakpoint trap.
0x1000044c0002d032 in ?? ()
(gdb) bt
#0  0x1000044c0002d032 in ?? ()
#1  0x0007d5a400000000 in ?? ()
Cannot access memory at address 0xfffff4f010018940
(gdb) n
Cannot find bounds of current function

On Sat, 2009-02-28 at 10:13 +0100, Laurent GUERBY wrote:
> Hi,
> 
> I built GDB 6.8 on sparc64-linux (running debian etch / kernel Debian
> 2.6.18.dfsg.1-24) as follows:
> 
> ./configure --prefix=/opt/cfarm/gdb-6.8-64 --target=sparc64-unknown-linux-gnu --disable-nls
> 
> With this GDB I'm unable to breakpoint on a simple C program compiled in
> 64 bits as shown below. System provided GDB 6.4.90 seems to work a bit
> better (however it doesn't work when threading is present hence
> my try of a newer GCC).
> 
> Any idea?
> 
> For access to the platform feel free to request an account on the
> GCC Compile Farm which is open to all free software developpers, not
> only GCC, following instructions given here:
> 
> http://gcc.gnu.org/wiki/CompileFarm
> 
> Current platforms (running Linux):
> 
> * i686 
>   * x86_64, including three bi-quad core with 16 GB of RAM 
>   * armv5tel 
>   * powerpc 
>   * powerpc64 
>   * sparc 
>   * sparc64 (sparcv9) 
>   * alpha 
>   * mipsel 
>   * mips64el 
>   * ia64 
> 
> The machine I used for sparc64-linux is "gcc54".
> 
> I also noticed the archive for gdb-testresults seems empty, is there
> another place to look for? Automatic testers via crontab are of course
> allowed on the compile farm.
> 
> Sincerely,
> 
> Laurent
> 
> guerby@gcc54:~/tmp$ cat ttt.c
> #include <stdio.h>
> int main(void) {
>  printf("hello\n");
>  return 0;
> }
> guerby@gcc54:~/tmp$ gcc -g -m64 ttt.c
> guerby@gcc54:~/tmp$ file ./a.out
> ./a.out: ELF 64-bit MSB executable, SPARC V9, version 1 (SYSV), for GNU/Linux 2.4.18, dynamically linked (uses shared libs), for GNU/Linux 2.4.18, not stripped
> guerby@gcc54:~/tmp$ gdb ./a.out 
> GNU gdb 6.8
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "sparc64-unknown-linux-gnu"...
> (gdb) set debug infrun 1
> (gdb) r
> Starting program: /home/guerby/tmp/a.out 
> infrun: wait_for_inferior (treat_exec_as_sigtrap=1)
> infrun: infwait_normal_state
> infrun: TARGET_WAITKIND_STOPPED
> infrun: stop_pc = 0xf7ec90000033f398
> infrun: quietly stopped
> infrun: stop_stepping
> infrun: resume (step=0, signal=0)
> infrun: wait_for_inferior (treat_exec_as_sigtrap=1)
> infrun: infwait_normal_state
> infrun: TARGET_WAITKIND_STOPPED
> infrun: stop_pc = 0xf7ec90000033f398
> infrun: quietly stopped
> infrun: stop_stepping
> infrun: proceed (addr=0xffffffffffffffff, signal=0, step=0)
> infrun: resume (step=0, signal=0)
> infrun: wait_for_inferior (treat_exec_as_sigtrap=0)
> hello
> infrun: infwait_normal_state
> infrun: TARGET_WAITKIND_EXITED
> 
> Program exited normally.
> infrun: stop_stepping
> (gdb) b main
> Breakpoint 1 at 0x100550: file ttt.c, line 3.
> (gdb) r
> Starting program: /home/guerby/tmp/a.out 
> infrun: wait_for_inferior (treat_exec_as_sigtrap=1)
> infrun: infwait_normal_state
> infrun: TARGET_WAITKIND_STOPPED
> infrun: stop_pc = 0xf7ec90000034ec88
> infrun: quietly stopped
> infrun: stop_stepping
> infrun: resume (step=0, signal=0)
> infrun: wait_for_inferior (treat_exec_as_sigtrap=1)
> infrun: infwait_normal_state
> infrun: TARGET_WAITKIND_STOPPED
> infrun: stop_pc = 0xf7ec90000034ec88
> infrun: quietly stopped
> infrun: stop_stepping
> infrun: proceed (addr=0xffffffffffffffff, signal=0, step=0)
> infrun: resume (step=0, signal=0)
> infrun: wait_for_inferior (treat_exec_as_sigtrap=0)
> infrun: infwait_normal_state
> infrun: TARGET_WAITKIND_STOPPED
> infrun: stop_pc = 0xf7ec90000033fdd0
> infrun: random signal 5
> 
> Program received signal SIGTRAP, Trace/breakpoint trap.
> infrun: stop_stepping
> 0xf7ec90000033fdd0 in ?? ()
> (gdb) bt
> #0  0xf7ec90000033fdd0 in ?? ()
> #1  0xffffc9e000000008 in ?? ()
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
> (gdb) n
> Cannot find bounds of current function
> (gdb) q
> guerby@gcc54:~/tmp$ /usr/bin/gdb a.out
> GNU gdb 6.4.90-debian
> Copyright (C) 2006 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 "sparc-linux-gnu"...
> warning: A handler for the OS ABI "GNU/Linux" is not built into this configuration
> of GDB.  Attempting to continue with the default sparc:v9 settings.
> 
> Using host libthread_db library "/lib/v9/libthread_db.so.1".
> 
> (gdb) b main
> Breakpoint 1 at 0x100550: file ttt.c, line 3.
> (gdb) r
> Starting program: /home/guerby/tmp/a.out 
> warning: no shared library support for this OS / ABI
> 
> Breakpoint 1, main () at ttt.c:3
> 3	 printf("hello\n");
> (gdb) n
> hello
> 4	 return 0;
> (gdb) q
> The program is running.  Exit anyway? (y or n) y
> 
> 
> 



More information about the Gdb mailing list