Stepping problem while debugging gdb 7.6 on darwin 10.8 (osx 10.6.8)

Rene Wang renewangtw@gmail.com
Sat Feb 8 08:28:00 GMT 2014


Problem:

Try to debug a simple c++ file with gdb 7.6. gdb 7.6 failed to load symbol from dynamic libraries. It also complains 
1) solib_create_inferior_hook failed to load shared libraries when I try to debug code with boost library
2) unhandled stab for dwarf OSO file

What I saw on my macbook.  

ReneWangs-MacBook:Exercise renewang$ ggdb ./Derived
GNU gdb (GDB) 7.6
Copyright (C) 2013 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 "i386-apple-darwin10.8.0".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /Users/renewang/Documents/e-course/C++ For C Programmers/Exercise/Derived...Reading symbols from /Users/renewang/Documents/e-course/C++ For C Programmers/Exercise/Derived.dSYM/Contents/Resources/DWARF/Derived...done.
done.
(gdb) set verbose
(gdb) set complaints 100
(gdb) b main
Reading in symbols for Derived.cpp...done.
Breakpoint 1 at 0x1ae2: file Derived.cpp, line 18.
(gdb) r
Starting program: /Users/renewang/Documents/e-course/C++ For C Programmers/Exercise/Derived 
warning: platform-specific solib_create_inferior_hook did not load initial shared libraries.
Reading symbols from /opt/local/lib/libgcc/libstdc++.6.dylib...(no debugging symbols found)...done.
Loaded symbols for /opt/local/lib/libgcc/libstdc++.6.dylib
Reading symbols from /usr/lib/libSystem.B.dylib...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libSystem.B.dylib
Reading symbols from /opt/local/lib/libgcc/libgcc_s.1.dylib...(no debugging symbols found)...done.
Loaded symbols for /opt/local/lib/libgcc/libgcc_s.1.dylib
Reading symbols from /usr/lib/system/libmathCommon.A.dylib...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/system/libmathCommon.A.dylib

incomplete CFI data; unspecified registers (e.g., eax) at 0x1bf5...incomplete CFI data; unspecified registers (e.g., ecx) at 0x1bf5...incomplete CFI data; unspecified registers (e.g., edx) at 0x1bf5...incomplete CFI data; unspecified registers (e.g., esi) at 0x1bf5...incomplete CFI data; unspecified registers (e.g., edi) at 0x1bf5...Breakpoint 1, main () at Derived.cpp:18
18		Derived d1;
(gdb) n
0x00001d5c in ?? ()

PS: I sometimes will see unable to handle OSO file which uses precompiled boost library.
Start it from the beginning? (y or n) y
Starting program: /opt/boost_1_55_0/libs/thread/bin/once 
warning: platform-specific solib_create_inferior_hook did not load initial shared libraries.
Reading symbols from /usr/lib/system/libmathCommon.A.dylib...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/system/libmathCommon.A.dylib
Reading symbols from /usr/local/lib/libboost_system.dylib...unhandled stab for dwarf OSO file...unhandled stab for dwarf OSO file...unhandled stab for dwarf OSO file...unhandled stab for dwarf OSO file...Reading symbols from /opt/boost_1_55_0/bin.v2/libs/system/build/darwin-4.2.1/release/threading-multi/error_code.o...


System:

ReneWangs-MacBook:Exercise renewang$ uname -a
Darwin ReneWangs-MacBook.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386

g++ version
ReneWangs-MacBook:Exercise renewang$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/i386-apple-darwin10/4.8.2/lto-wrapper
Target: i386-apple-darwin10
Configured with: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc48/gcc48/work/gcc-4.8.2/configure --prefix=/opt/local --build=i386-apple-darwin10 --enable-languages=c,c++,objc,obj-c++,lto,fortran,java --libdir=/opt/local/lib/gcc48 --includedir=/opt/local/include/gcc48 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-4.8 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-4.8 --with-gxx-include-dir=/opt/local/include/gcc48/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-cloog=/opt/local --enable-cloog-backend=isl --disable-cloog-version-check --enable-stage1-checking --disable-multilib --enable-lto --enable-libstdcxx-time --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --with-pkgversion='MacPorts gcc48 4.8.2_0'
Thread model: posix
gcc version 4.8.2 (MacPorts gcc48 4.8.2_0) 

compile commands: (I've tried different debugging options with g++ such as -g3, -ggdb, and -gdwarf-2 -gstrict-dwarf)
g++ -Wall -gdwarf-2 -gstrict-dwarf -o Derived Derived.cpp

dsymutil version:
ReneWangs-MacBook:Exercise renewang$ dsymutil -v
@(#)PROGRAM:dsymutil  PROJECT:dwarfutils-79

Attached source code and dwaf file 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: source.tgz
Type: application/octet-stream
Size: 16290 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb/attachments/20140208/182dd894/attachment.obj>
-------------- next part --------------









More information about the Gdb mailing list