gdb with python support still get crash on showing uninitialized local variables

asmwarrior asmwarrior@gmail.com
Wed Oct 20 05:19:00 GMT 2010


On 2010-10-20 4:17, Tom Tromey wrote:
 > reading variable s (Cannot access memory at address 0x80)
 > Tom> I am working on a fix for this.
 >
 > Tom> Currently all gdb exceptions are convert to a Python 
RuntimeError.  But,
 > Tom> I think we should differentiate a little more.  In particular, I 
think a
 > Tom> gdb MEMORY_ERROR should be a separate class, and should be handled
 > Tom> specially by the pretty-printing code (basically by omitting the 
stack
 > Tom> trace).
 >
 > This patch implements this idea.  It adds some new subclasses of
 > RuntimeError, including one specifically for MEMORY_ERROR.  Then it
 > arranges for the memory error exception to be treated specially by the
 > pretty-printing code.
 >
 > Built and regtested on x86-64 (compile farm).
 > Some new test cases are included.
 >
 > asmwarrior, it would be helpful if you could try this out.
 >
 > Ok?
 >
 > Tom
 >
OK.


I just use git to check out the latest whole gdb source (>100M)
Then apply your patch

Then use MSYS + MINGW GCC 4.4.4 to build it .

But I failed with the build error. like:

../../gdb/libiberty/fibheap.c:151: warning: incompatible implicit 
declaration of
  built-in function 'free'
../../gdb/libiberty/fibheap.c:156: warning: incompatible implicit 
declaration of
  built-in function 'free'
../../gdb/libiberty/fibheap.c:172: warning: incompatible implicit 
declaration of
  built-in function 'free'
../../gdb/libiberty/fibheap.c: In function 'fibheap_extract_min':
../../gdb/libiberty/fibheap.c:190: warning: incompatible implicit 
declaration of
  built-in function 'free'
../../gdb/libiberty/fibheap.c: In function 'fibheap_replace_key_data':
../../gdb/libiberty/fibheap.c:220: error: 'LONG_MIN' undeclared (first 
use in th
is function)
../../gdb/libiberty/fibheap.c:220: error: (Each undeclared identifier is 
reporte
d only once
../../gdb/libiberty/fibheap.c:220: error: for each function it appears in.)
../../gdb/libiberty/fibheap.c: In function 'fibheap_delete_node':
../../gdb/libiberty/fibheap.c:261: error: 'LONG_MIN' undeclared (first 
use in th
is function)
../../gdb/libiberty/fibheap.c:265: warning: implicit declaration of 
function 'ab
ort'
../../gdb/libiberty/fibheap.c:265: warning: incompatible implicit 
declaration of
  built-in function 'abort'
../../gdb/libiberty/fibheap.c: In function 'fibheap_delete':
../../gdb/libiberty/fibheap.c:277: warning: incompatible implicit 
declaration of
  built-in function 'free'
../../gdb/libiberty/fibheap.c: In function 'fibheap_consolidate':
../../gdb/libiberty/fibheap.c:368: warning: implicit declaration of 
function 'me
mset'
../../gdb/libiberty/fibheap.c:368: warning: incompatible implicit 
declaration of
  built-in function 'memset'
make[2]: *** [fibheap.o] Error 1
make[2]: Leaving directory `e:/test/build/libiberty'
make[1]: *** [all-libiberty] Error 2
make[1]: Leaving directory `e:/test/build'
make: *** [all] Error 2

When I manually add this macro definition then continue the build, I got 
other more errors.

I can remember that the snapshot of GDB source 20101005, I can build it 
successful. I'm not sure why.

Asmwarrior.

BTW:

My friend Loaden has some build errors when building gdb.exe (weekly 
20101019) from linux, here is his build log:

  /bin/install -c -m 644 ../../../../src/gdb/bfd/doc/bfd.info 
'/home/loaden/gdb/share/info'
  install-info --info-dir='/home/loaden/gdb/share/info' 
'/home/loaden/gdb/share/info/bfd.info'
make[4]: Leaving directory `/home/loaden/AUR/gdb/build/gdb-win/bfd/doc'
Making install in po
make[4]: Entering directory `/home/loaden/AUR/gdb/build/gdb-win/bfd/po'
if test -r ../../../../src/gdb/bfd/../mkinstalldirs; then \
       ../../../../src/gdb/bfd/../mkinstalldirs /home/loaden/gdb/share; \
     else \
       ../../../../src/gdb/bfd/mkinstalldirs /home/loaden/gdb/share; \
     fi
/bin/sh: line 1: ../../../../src/gdb/bfd/../mkinstalldirs: Permission denied
make[4]: *** [install-data-yes] Error 126
make[4]: Leaving directory `/home/loaden/AUR/gdb/build/gdb-win/bfd/po'
make[4]: Entering directory `/home/loaden/AUR/gdb/build/gdb-win/bfd'
make[5]: Entering directory `/home/loaden/AUR/gdb/build/gdb-win/bfd'
make[5]: Nothing to be done for `install-exec-am'.
test -z "/home/loaden/gdb/include" || /bin/mkdir -p 
"/home/loaden/gdb/include"
  /bin/install -c -m 644 bfd.h 
../../../src/gdb/bfd/../include/ansidecl.h 
../../../src/gdb/bfd/../include/symcat.h 
../../../src/gdb/bfd/../include/bfdlink.h '/home/loaden/gdb/include'
test -z "/home/loaden/gdb/lib" || /bin/mkdir -p "/home/loaden/gdb/lib"
  /bin/sh ./libtool   --mode=install /bin/install -c   libbfd.la 
'/home/loaden/gdb/lib'
libtool: install: /bin/install -c .libs/libbfd.lai 
/home/loaden/gdb/lib/libbfd.la
libtool: install: /bin/install -c .libs/libbfd.a 
/home/loaden/gdb/lib/libbfd.a
libtool: install: chmod 644 /home/loaden/gdb/lib/libbfd.a
libtool: install: i686-mingw32-ranlib /home/loaden/gdb/lib/libbfd.a
libtool: install: warning: remember to run `libtool --finish 
/home/loaden/AUR/gdb/depends/lib'
make[5]: Leaving directory `/home/loaden/AUR/gdb/build/gdb-win/bfd'
make[4]: Leaving directory `/home/loaden/AUR/gdb/build/gdb-win/bfd'
make[3]: *** [install-recursive] Error 1
make[3]: Leaving directory `/home/loaden/AUR/gdb/build/gdb-win/bfd'
make[2]: *** [install] Error 2
make[2]: Leaving directory `/home/loaden/AUR/gdb/build/gdb-win/bfd'
make[1]: *** [install-bfd] Error 2
make[1]: Leaving directory `/home/loaden/AUR/gdb/build/gdb-win'
make: *** [install] Error 2






More information about the Gdb mailing list