0

We are having trouble to debug C/C++ program core files (the program was built by GCC 4.6.1), even with the debug version, though file command showed debugging information and symbols are available.

The symbol won't be human-readable in gdb at all even provisioned with correct debug executable.Any one can cast any light over this?

BTW, the core file can't analyzed by "mdb" or "adb" either. Each time adb is launched, a new core would be generated.

Debugging with gdb generates errors like:

warning: Cannot initialize thread debugging library: Debugger service failed
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers

Also tried building gdb from source, no luck. Added "LD_PRELOAD=/usr/lib/libpthread.so.1" before launching gdb didn't work either ( actually the program was linked with -lpthread).

alk
  • 69,737
  • 10
  • 105
  • 255
Fei
  • 1,450
  • 1
  • 17
  • 30
  • Is it C or C++? C++ compilation can perform name mangling – fge Dec 27 '11 at 01:34
  • It's a program including C++ code, while I don't think name mangling bothers here. – Fei Dec 28 '11 at 06:42
  • You might take a look here: http://stackoverflow.com/questions/114236/solaris-core-dump-analysis – alk Dec 28 '11 at 15:55
  • @alk Thanks for the tips, though we have been using the toolkits (mdb/adb) in our team for over 2 years. The problem is now each time I launch adb it would generate a new core for itself in _/tmp_ folder. Seems librtld_db can't be loaded properly with GCC 4.6. – Fei Dec 29 '11 at 01:58
  • Try this article: http://www.fayewilliams.com/2013/01/31/gdb-unable-to-find-dynamic-linker-breakpoint-function/ – Agnel Kurian Feb 06 '13 at 05:30

1 Answers1

0

To receive a usable core file make sure your sources have been compiled using the -g option, prior to being linked into the executable.

To load the core, call:

gdb executable-which-the-core-was-created-from core-file
alk
  • 69,737
  • 10
  • 105
  • 255