[lldb-dev] Support for Linux core files

Greg Clayton gclayton at apple.com
Mon Oct 15 09:49:59 PDT 2012

On Oct 15, 2012, at 3:09 AM, Martin Milata <xmilata at fi.muni.cz> wrote:

> Hello,
> I would like to write a simple tool that, given a Linux core dump,
> produces a list of variables and their values (for those variables for
> which it can be determined). I'm considering writing the tool on top of

That should be easy.

> If I understand correctly, there is no support for Linux cores in LLDB.

Correct, there is no linux core support currently.

> What would it take to implement it?

We support mach-o core files, so there is some great example code that should be easy to adapt. The the mach-o core file example plug-in:


> Is it just a matter of implementing
> the Process subclass for Linux cores?

Yes, see very simple and quick example in lldb/source/Plugins/Process/mach-core. Basically the linux plug-in will need to recognize linux core files and know how to parse them. I am not sure what the linux core file format is. On MacOSX, our core files are just mach-o files (very similar to executable files). As long as the linux core file is an ELF file, you should be good to go and the port should be easy. If not, you will need to write a "ObjectFile" subclass to parse the core file, or just parse it manually in your ProcessLinuxCore (you might want to name this ProcessELFCore if it is not tied to linux).

> Or is there any other Linux-related functionality missing?

There is a lot of work going on for Linux right now, so it should be pretty functional as far as running/attaching.

> I see that there is support for
> Linux processes but I haven't been successful in compiling LLDB yet, so
> I can not try it out myself.

See the other messages on this build list. The message thread right before you e-mail had details on how to successfully build on linux.

> Thanks,
> Martin Milata
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

More information about the lldb-dev mailing list