This is the mail archive of the gdb-prs@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]

breakpoints/2331: gdb cannot break on entry point for statically linked binaries


>Number:         2331
>Category:       breakpoints
>Synopsis:       gdb cannot break on entry point for statically linked binaries
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 11 09:38:01 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     xt28@gmx.de
>Release:        gdb 6.7.50_20071011
>Organization:
>Environment:
$ uname -a
Linux x20 2.6.20-16-generic #2 SMP Sun Sep 23 19:50:39 UTC 2007 i686 GNU/Linux

$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 (Ubuntu 4.1.2-0ubuntu4)

GDB config line:
This GDB was configured as "i686-pc-linux-gnu"...
>Description:
When debugging a statically linked binary, setting a breakpoint at the program's entry point does not work, i.e. the breakpoint is set, but execution does not stop at the breakpoint.
>How-To-Repeat:
See the following transcript:

$ ./gdb /sbin/ldconfig 
GNU gdb 6.7.50_20071011
Copyright (C) 2007 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 "i686-pc-linux-gnu"...
(no debugging symbols found)
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) info files
Symbols from "/sbin/ldconfig".
Local exec file:
        `/sbin/ldconfig', file type elf32-i386.
        Entry point: 0x8048110
        0x080480d4 - 0x080480f4 is .note.ABI-tag
        0x080480f4 - 0x0804810b is .init
        0x08048110 - 0x080b84c8 is .text
        [...]
        0x080d7400 - 0x080d7ba8 is .data
        0x080d7bc0 - 0x080d9b68 is .bss
        0x080d9b68 - 0x080d9b7c is __libc_freeres_ptrs
(gdb) break *0x8048110
Breakpoint 1 at 0x8048110
(gdb) run
Starting program: /sbin/ldconfig 
(no debugging symbols found)
/sbin/ldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission denied

Program exited with code 01.
(gdb) quit

====

I compiled the current gdb from source, but did not install it or any libraries.

$ ldd ./gdb
        linux-gate.so.1 =>  (0xffffe000)
        libncurses.so.5 => /lib/libncurses.so.5 (0xb7eae000)
        libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7e87000)
        libexpat.so.1 => /usr/lib/libexpat.so.1 (0xb7e66000)
        libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7e62000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7d21000)
        /lib/ld-linux.so.2 (0xb7f01000)
        libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7d0a000)
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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