[lldb-dev] Patch to support ELF coredumps

Samuel Jacob samueldotj at gmail.com
Sun Feb 24 06:37:16 PST 2013


Hi,

I herewith attached a patch to support ELF coredumps.
Currently it works for Linux X86-64 core files.
Please commit it.

Here is the output of a test program

$Debug+Asserts/bin/lldb ~/test/a.out -c ~/test/core
Core file '/mts/home3/jacobs/test/core' (x86_64) was loaded.
Process 0 stopped
* thread #1: tid = 0x0000, 0x00000000004004c4 a.out`function4(arg=0) + 16
at test.c:4, stop reason = signal SIGSEGV
    frame #0: 0x00000000004004c4 a.out`function4(arg=0) + 16 at test.c:4
   1    void function4(unsigned int arg)
   2    {
   3        char *local = 0;
-> 4        *local = 0;
   5    }
   6    void function3()
   7    {
bt
* thread #1: tid = 0x0000, 0x00000000004004c4 a.out`function4(arg=0) + 16
at test.c:4, stop reason = signal SIGSEGV
    frame #0: 0x00000000004004c4 a.out`function4(arg=0) + 16 at test.c:4
    frame #1: 0x00000000004004d7 a.out`function3 + 11 at test.c:8
    frame #2: 0x00000000004004e7 a.out`function2(arg=4195559) + 11 at
test.c:11
    frame #3: 0x00000000004004f7 a.out`function1(arg1=0,
arg2=140736328348032, str=0x00000000004004e7) + 3 at test.c:15
    frame #4: 0x0000000000400507 a.out`function1(arg1=0,
arg2=140736328348048, str=0x00000000004004f7) + 19 at test.c:15
    frame #5: 0x00007fbcdfe6c76d libc.so.6`__libc_start_main + 237
    frame #6: 0x00000000004003f9 a.out`_start + 41

The following may be used as commit log:

Added Process plugin to support ELF coredump files.
Added member functions in ObjectFileELF to access segment headers and data.
Modified POSIX dynamic loader plugin to get AUXV data from core files if
core-file is used.
Modified Linux Process plugin so that it will skip handling core
files(CanDebug()).

Regards,
Samuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20130224/57c5a1e7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: elf-core.diff
Type: application/octet-stream
Size: 44561 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20130224/57c5a1e7/attachment.obj>


More information about the lldb-dev mailing list