[Lldb-commits] [lldb] Add `target modules dump separate-debug-info` (PR #66035)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 11 17:58:56 PDT 2023


clayborg wrote:

> I don't think the lldb command line dumps raw JSON anywhere as a command result. Can we make something a little more human readable?

It was my idea to make this JSON. The problem is each debug info (.dwo and DWARF in .o files for Mac) has very different fields and pretty printing these items free form looked like it should be JSON. For DWO we have the DW_AT_dwo_name, DW_AT_comp_dir, and DW_AT_dwo_id to display, and for OSO we have .o file path + mod time. I wanted the ability to be able to parse the output and use it in a script so the JSON was nice for that end game. It also allows us to include this information in "statistics dump". 

> BTW, the idea seems useful to me, but particularly if you're doing OSO you can get a whole lot of these so a space efficient presentation where you can scan the names easily, etc, will be important as well.

Maybe we can add an extra "flavor" to the JSON output, and then have a format string for how the output can look akin to the "frame-format" that the command would use by default? That would allow us to format the output in a nice human readable way for the command output, and also add a --json option to the command. The format string could use the "flavor" ("oso" or "dwo") to format the output string as needed?

https://github.com/llvm/llvm-project/pull/66035


More information about the lldb-commits mailing list