When I ran "make check" on Linux/i386 with gdb trunk on 2010-02-17, I got Starting program: /export/build/gnu/gdb/build-i686-linux/gdb/testsuite/gdb.arch/i386-disp-step ^M /net/gnu-6/export/gnu/import/git/gdb/gdb/solib-svr4.c:1468: internal-error: enable_break: Assertion `load_addr < space_size' failed.^M A problem internal to GDB has been detected,^M further debugging may prove unreliable.^M Quit this debugging session? (y or n) FAIL: gdb.arch/i386-disp-step.exp: running to main in runto (timeout) FAIL: gdb.arch/i386-disp-step.exp: Can't run to main It may be caused by http://sourceware.org/ml/gdb-cvs/2010-02/msg00083.html
I meant this patch: http://sourceware.org/ml/gdb-cvs/2010-02/msg00135.html
This code --- if (addr_bit < (sizeof (ULONGEST) * HOST_CHAR_BIT)) { CORE_ADDR space_size = (ULONGEST) 1 << addr_bit; CORE_ADDR tmp_entry_point = exec_entry_point (tmp_bfd, tmp_bfd_target); gdb_assert (load_addr < space_size); /* TMP_ENTRY_POINT exceeding SPACE_SIZE would be for prelinked 64bit ld.so with 32bit executable, it should not happen. */ if (tmp_entry_point < space_size && tmp_entry_point + load_addr >= space_size) load_addr -= space_size; } --- doesn't make much senses. For 32bit, addr_bit is 32 and CORE_ADDR is 4 byte. CORE_ADDR space_size = (ULONGEST) 1 << addr_bit; will overflow.
This patch: --- diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index b3b9e00..f4fccb2 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -1459,7 +1459,7 @@ enable_break (struct svr4_info *info, int from_tty) invalid addresses like 0x101234567 for 32bit inferiors on 64bit GDB. */ - if (addr_bit < (sizeof (ULONGEST) * HOST_CHAR_BIT)) + if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT)) { CORE_ADDR space_size = (ULONGEST) 1 << addr_bit; CORE_ADDR tmp_entry_point = exec_entry_point (tmp_bfd, -- seems to work.
A patch is posted at http://sourceware.org/ml/gdb-patches/2010-02/msg00439.html
Subject: Bug 11293 CVSROOT: /cvs/src Module name: src Changes by: hjl@sourceware.org 2010-02-17 20:47:08 Modified files: gdb : ChangeLog solib-svr4.c Log message: Use CORE_ADDR instead of ULONGEST on address. 2010-02-17 H.J. Lu <hongjiu.lu@intel.com> PR shlibs/11293 * solib-svr4.c (enable_break): Check size of CORE_ADDR instead of ULONGEST for address size. Patches: http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.11372&r2=1.11373 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/solib-svr4.c.diff?cvsroot=src&r1=1.123&r2=1.124
Fixed.