[Lldb-commits] [PATCH] D18464: Implement `target modules dump headers`

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 1 11:30:29 PDT 2016

clayborg added a comment.

In http://reviews.llvm.org/D18464#389612, @zturner wrote:

> FWIW I believe we do actually want many of the PE headers, although I have to say I don't like the format of the output.    It seems like we could break this up into smaller chunks like section headers, pe headers, binary headers, debug headers, and then allow the user to specify some combination of flags (or all) to display different levels of detail.  But that could come as a followup.  And also translate some of the hex codes to textual enum values like IMAGE_MACHINE_386 so it's easier to understand the output.
> In the future we might even want a way to add operating system specific stuff to the dump.  Windows for example can have resource files embedded in them that show file version and things like that, and it's nice to get a unified view that shows some of this OS specific stuff interspersed in a nicely formatted manner.  A lot of this type of information is useful for crash reporting and bucketing

I agreed. To go a step further, we could have ObjectFile::Dump() take an extra "Args &args" parameter where each object file can have its own dumping args. It could then allow the PECOFF dumping to have options that are similar to the program that actually dumps things on the windows platform, mach-o can have options for dumping load command and many other mach specific things, and ELF could have options to dump the program and sections headers, the raw ELF symbol table and much more. Then the new "objfile" command could chop up any remaining args and pass then down into ObjectFile::Dump().


More information about the lldb-commits mailing list