summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r314817 "[dwarfdump] Add -lookup option"Hans Wennborg2017-10-031-36/+5
| | | | | | | | | | | | | | | | | The test fails on Linux; see follow-up email on the llvm-commits list. > Add the option to lookup an address in the debug information and print > out the file, function, block and line table details. > > Differential revision: https://reviews.llvm.org/D38409 This also reverts the follow-up r314818: > [test] Fix llvm-dwarfdump/cmdline.test > > Fixes test/tools/llvm-dwarfdump/cmdline.test llvm-svn: 314825
* [dwarfdump] Add -lookup optionJonas Devlieghere2017-10-031-5/+36
| | | | | | | | | Add the option to lookup an address in the debug information and print out the file, function, block and line table details. Differential revision: https://reviews.llvm.org/D38409 llvm-svn: 314817
* llvm-dwarfdump: support the --ignore-case option.Adrian Prantl2017-10-021-3/+12
| | | | llvm-svn: 314723
* [dwarfdump] Add -show-formJonas Devlieghere2017-10-021-3/+10
| | | | | | | | | This enables printing of DWARF form types after the DWARF attribute types. Differential revision: https://reviews.llvm.org/D38459 llvm-svn: 314685
* typosAdrian Prantl2017-09-301-3/+3
| | | | llvm-svn: 314577
* llvm-dwarfdump: implement the --name lookup option.Adrian Prantl2017-09-301-9/+39
| | | | llvm-svn: 314576
* Add commentsAdrian Prantl2017-09-301-0/+5
| | | | llvm-svn: 314574
* llvm-dwarfdump: support .apple-namespaces in --findAdrian Prantl2017-09-291-0/+2
| | | | llvm-svn: 314481
* llvm-dwarfdump: add support for .apple_types in --findAdrian Prantl2017-09-291-5/+14
| | | | llvm-svn: 314479
* try and appease gccAdrian Prantl2017-09-281-1/+1
| | | | llvm-svn: 314442
* llvm-dwarfdump: implement --find for .apple_namesAdrian Prantl2017-09-281-1/+24
| | | | | | | | | | | | This patch implements the dwarfdump option --find=<name>. This option looks for a DIE in the accelerator tables and dumps it if found. This initial patch only adds support for .apple_names to keep the review small, adding the other sections and pubnames support should be trivial though. Differential Revision: https://reviews.llvm.org/D38282 llvm-svn: 314439
* Commit missing fixes for tool_file_renameReid Kleckner2017-09-231-2/+2
| | | | llvm-svn: 314051
* [dwarfdump] Fix ambiguous call to make_uniqueJonas Devlieghere2017-09-221-2/+2
| | | | | | | | Fix buildbot failures: - http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc2015/builds/13153 - http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/13566 llvm-svn: 313971
* [dwarfdump] Add support for redirecting output to a fileJonas Devlieghere2017-09-221-24/+44
| | | | | | | | | This patch adds the -o and --out-file options for compatibility with Darwin's dwarfdump. Differential revision: https://reviews.llvm.org/D38125 llvm-svn: 313969
* llvm-dwarfdump: Add support for the --arch command line option.Adrian Prantl2017-09-211-16/+57
| | | | llvm-svn: 313888
* llvm-dwarfdump: move -eh-frame into the right section in the help output.Adrian Prantl2017-09-201-1/+1
| | | | llvm-svn: 313836
* llvm-dwarfdump: implement --recurse-depth=<N>Adrian Prantl2017-09-201-0/+11
| | | | | | | | | | This patch implements the Darwin dwarfdump option --recurse-depth=<N>, which limits the recursion depth when selectively printing DIEs at an offset. Differential Revision: https://reviews.llvm.org/D38064 llvm-svn: 313778
* llvm-dwarfdump: un-hide more command line optionsAdrian Prantl2017-09-191-4/+9
| | | | llvm-svn: 313673
* Replace for_each with a range-based for. NFC.Adrian Prantl2017-09-181-4/+2
| | | | llvm-svn: 313578
* llvm-dwarfdump: add a --show-parents options when selectively dumping DIEs.Adrian Prantl2017-09-181-1/+8
| | | | llvm-svn: 313567
* [dwarfdump] Make .eh_frame an alias for .debug_frameJonas Devlieghere2017-09-181-1/+3
| | | | | | | | | | | | | | | | | | | | This patch makes the `.eh_frame` extension an alias for `.debug_frame`. Up till now it was only possible to dump the section using objdump, but not with dwarfdump. Since the two are essentially interchangeable, we dump whichever of the two is present. As a workaround, this patch also adds parsing for 3 currently unimplemented CFA instructions: `DW_CFA_def_cfa_expression`, `DW_CFA_expression`, and `DW_CFA_val_expression`. Because I lack the required knowledge, I just parse the fields without actually creating the instructions. Finally, this also fixes the typo in the `.debug_frame` section name which incorrectly contained a trailing `s`. Differential revision: https://reviews.llvm.org/D37852 llvm-svn: 313530
* llvm-dwarfdump: support a --show-children optionAdrian Prantl2017-09-161-0/+7
| | | | | | | This will print all children of a DIE when selectively printing only one DIE at a given offset. llvm-svn: 313464
* llvm-dwarfdump: Add support for -debug-info=<offset>.Adrian Prantl2017-09-151-10/+77
| | | | | | | | | This is the first of many commits that enable selectively dumping just one record from the debug info. This reapplies r313412 with some extra qualification to appease GCC and MSVC. llvm-svn: 313419
* Revert "llvm-dwarfdump: Add support for -debug-info=<offset>."Adrian Prantl2017-09-151-73/+10
| | | | | | This reverts commit r313412 because of a g++ incompatibility. llvm-svn: 313413
* llvm-dwarfdump: Add support for -debug-info=<offset>.Adrian Prantl2017-09-151-10/+73
| | | | | | | This is the first of many commits that enable selectively dumping just one record from the debug info. llvm-svn: 313412
* llvm-dwarfdump: support dumping static archives.Adrian Prantl2017-09-141-7/+37
| | | | llvm-svn: 313272
* Use MemoryBufferRef. (NFC)Adrian Prantl2017-09-131-3/+2
| | | | llvm-svn: 313212
* Factor out duplicate code from llvm-dwarfdump (NFC)Adrian Prantl2017-09-131-38/+27
| | | | llvm-svn: 313211
* llvm-dwarfdump: automatically dump both regular and .dwo variant of sectionsAdrian Prantl2017-09-131-3/+2
| | | | | | | | | | | | Since users typically don't really care about the .dwo / non.dwo distinction, this patch makes it so dwarfdump --debug-<info,...> dumps .debug_info and (if available) also .debug_info.dwo. This simplifies the command line interface (I've removed all dwo-specific dump options) and makes the tool friendlier to use. Differential Revision: https://reviews.llvm.org/D37771 llvm-svn: 313207
* llvm-dwarfdump: support dumping UUIDs of Mach-O binaries.Adrian Prantl2017-09-131-4/+9
| | | | | | | This is a feature supported by Darwin dwarfdump. UUIDs are used to associate executables with their .dSYM bundles. llvm-svn: 313165
* [dwarfdump] Rename Brief to Verbose in DIDumpOptionsJonas Devlieghere2017-09-131-6/+10
| | | | | | | | | | | This patches renames "brief" to "verbose" in de DIDumpOptions and inverts the logic to match the new behavior where brief is the default. Changing the default value uncovered some bugs related to the DIDumpOptions not being propagated and have been fixed as well. Differential revision: https://reviews.llvm.org/D37745 llvm-svn: 313139
* Clean up the --help output of llvm-dwarfdump by hiding irrelevant options.Adrian Prantl2017-09-121-19/+41
| | | | llvm-svn: 313085
* llvm-dwarfdump: Make -brief the default and add a -verbose option instead.Adrian Prantl2017-09-111-5/+8
| | | | | | Differential Revision: https://reviews.llvm.org/D37717 llvm-svn: 312972
* llvm-dwarfdump: Replace -debug-dump=sect option with individual options.Adrian Prantl2017-09-111-39/+18
| | | | | | | | | | | | | | | | | | | | | | As discussed on llvm-dev in http://lists.llvm.org/pipermail/llvm-dev/2017-September/117301.html this changes the command line interface of llvm-dwarfdump to match the one used by the dwarfdump utility shipping on macOS. In addition to being shorter to type this format also has the advantage of allowing more than one section to be specified at the same time. In a nutshell, with this change $ llvm-dwarfdump --debug-dump=info $ llvm-dwarfdump --debug-dump=apple-objc becomes $ dwarfdump --debug-info --apple-objc Differential Revision: https://reviews.llvm.org/D37714 llvm-svn: 312970
* [llvm-dwarfdump] Brief mode only dumps debug_info by defaultJonas Devlieghere2017-08-311-3/+12
| | | | | | | | | | | | This patch changes the default behavior in brief mode to only show the debug_info section. This is undoubtedly the most popular and likely the one you'd want in brief mode. Non-brief mode behavior is not affected and still defaults to all. Differential revision: https://reviews.llvm.org/D37334 llvm-svn: 312252
* [dwarfdump] Pretty print location expressions and location listsReid Kleckner2017-08-291-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Based on Fred's patch here: https://reviews.llvm.org/D6771 I can't seem to commandeer the old review, so I'm creating a new one. With that change the locations exrpessions are pretty printed inline in the DIE tree. The output looks like this for debug_loc entries: DW_AT_location [DW_FORM_data4] (0x00000000 0x0000000000000001 - 0x000000000000000b: DW_OP_consts +3 0x000000000000000b - 0x0000000000000012: DW_OP_consts +7 0x0000000000000012 - 0x000000000000001b: DW_OP_reg0 RAX, DW_OP_piece 0x4 0x000000000000001b - 0x0000000000000024: DW_OP_breg5 RDI+0) And like this for debug_loc.dwo entries: DW_AT_location [DW_FORM_sec_offset] (0x00000000 Addr idx 2 (w/ length 190): DW_OP_consts +0, DW_OP_stack_value Addr idx 3 (w/ length 23): DW_OP_reg0 RAX, DW_OP_piece 0x4) Simple locations without ranges are printed inline: DW_AT_location [DW_FORM_block1] (DW_OP_reg4 RSI, DW_OP_piece 0x4, DW_OP_bit_piece 0x20 0x0) The debug_loc(.dwo) dumping in changed accordingly to factor the code. Reviewers: dblaikie, aprantl, friss Subscribers: mgorny, javed.absar, hiraditya, llvm-commits, JDevlieghere Differential Revision: https://reviews.llvm.org/D37123 llvm-svn: 312042
* Use delegation instead of inheritance.Rafael Espindola2017-07-191-3/+3
| | | | | | | | | | This changes DwarfContext to delegate to DwarfObject instead of having pure virtual methods. With this DwarfContextInMemory is replaced with an implementation of DwarfObject that is local to a .cpp file. llvm-svn: 308543
* [DWARF] Added a blank line in llvm-dwarfdump to test commit access.Spyridoula Gravani2017-06-121-0/+1
| | | | llvm-svn: 305220
* Introduce -brief command line option to llvm-dwarfdumpAdrian Prantl2017-06-061-0/+3
| | | | | | | | | | | | | This patch introduces a new command line option, called brief, to llvm-dwarfdump. When -brief is used, the attribute forms for the .debug_info section will not be emitted to output. Patch by Spyridoula Gravani! rdar://problem/21474365 Differential Revision: https://reviews.llvm.org/D33867 llvm-svn: 304844
* [DWARF] Adding support for the DWARF v5 string offsets table ↵Wolfgang Pieb2017-06-061-0/+1
| | | | | | | | | | (consumer/reader part only). Reviewers: dblaikie, aprantl Differential Revision: https://reviews.llvm.org/D32779 llvm-svn: 304759
* [DWARF] Introduce Dump OptionsAdrian Prantl2017-06-011-1/+5
| | | | | | | | | | | This commit introduces a structure that holds all the flags that control the pretty printing of dwarf output. Patch by Spyridoula Gravani! Differential Revision: https://reviews.llvm.org/D33749 llvm-svn: 304446
* Adds initial llvm-dwarfdump --verify support with unit tests.Greg Clayton2017-05-011-1/+52
| | | | | | | | | | | | | | | | | | lldb-dwarfdump gets a new "--verify" option that will verify a single file's DWARF debug info and will print out any errors that it finds. It will return an non-zero exit status if verification fails, and a zero exit status if verification succeeds. Adding the --quiet option will suppress any output the STDOUT or STDERR. The first part of the verify does the following: - verifies that all CU relative references (DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref4, DW_FORM_ref8, DW_FORM_ref_udata) have valid CU offsets - verifies that all DW_FORM_ref_addr references have valid .debug_info offsets - verifies that all DW_AT_ranges attributes have valid .debug_ranges offsets - verifies that all DW_AT_stmt_list attributes have valid .debug_line offsets - verifies that all DW_FORM_strp attributes have valid .debug_str offsets Unit tests were added for each of the above cases. Differential Revision: https://reviews.llvm.org/D32707 llvm-svn: 301844
* Fix a bugs with using some Mach-O command line flags like "-arch armv7m".Kevin Enderby2016-12-161-1/+1
| | | | | | | | | | | | | | | | | | The Mach-O command line flag like "-arch armv7m" does not match the arch name part of its llvm Triple which is "thumbv7m-apple-darwin”. I think the best way to fix this is to have llvm::object::MachOObjectFile::getArchTriple() optionally return the name of the Mach-O arch flag that would be used with -arch that matches the CPUType and CPUSubType. Then change llvm::object::MachOUniversalBinary::ObjectForArch::getArchTypeName() to use that and change it to getArchFlagName() as the type name is really part of the Triple and the -arch flag name is a Mach-O thing for a specific Triple with a specific Mcpu value. rdar://29663637 llvm-svn: 290001
* dwarfdump: -summarize-types: print a short summary (unqualified type name, ↵David Blaikie2016-10-181-1/+5
| | | | | | | | | | hash, length) of type units rather than dumping contents This is just a quick utility handy for getting rough summaries of types in a given object or dwo file. I've been using it to investigate the amount of type info redundancy across a project build, for example. llvm-svn: 284537
* Turn cl::values() (for enum) from a vararg function to using C++ variadic ↵Mehdi Amini2016-10-081-1/+1
| | | | | | | | | | | | | | | template The core of the change is supposed to be NFC, however it also fixes what I believe was an undefined behavior when calling: va_start(ValueArgs, Desc); with Desc being a StringRef. Differential Revision: https://reviews.llvm.org/D25342 llvm-svn: 283671
* Revert r282238 "Revert r282235 "[llvm-dwarfdump] - Teach dwarfdump to dump ↵George Rimar2016-09-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | gdb-index section."" Build bot issues (http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/15856/steps/ninja%20check%201/logs/FAIL%3A%20LLVM%3A%3Adwarfdump-dump-gdbindex.test) should be fixed in that version. Issue was that MSVS does not support "%zu". Though it works fine on MSCS 2015, Bot looks running MSVS 2013 that does not like it. MSDN also says that "z" prefix is not supported: https://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx I had to use PRId64 instead. Original commit message: [llvm-dwarfdump] - Teach dwarfdump to dump gdb-index section. gold linker's --gdb-index option currently is able to create the .gdb_index section that allows GDB to locate and read the .dwo files as it needs them, this helps reduce the total size of the object files processed by the linker. More info about that: https://gcc.gnu.org/wiki/DebugFission https://sourceware.org/gdb/onlinedocs/gdb/Index-Section-Format.html Patch teaches dwarfdump tool to dump this section. Differential revision: https://reviews.llvm.org/D21503 llvm-svn: 282239
* Revert r282235 "[llvm-dwarfdump] - Teach dwarfdump to dump gdb-index section."George Rimar2016-09-231-1/+0
| | | | | | | It broke BB: http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/15856 llvm-svn: 282238
* [llvm-dwarfdump] - Teach dwarfdump to dump gdb-index section.George Rimar2016-09-231-0/+1
| | | | | | | | | | | | | | | gold linker's --gdb-index option currently is able to create the .gdb_index section that allows GDB to locate and read the .dwo files as it needs them, this helps reduce the total size of the object files processed by the linker. More info about that: https://gcc.gnu.org/wiki/DebugFission https://sourceware.org/gdb/onlinedocs/gdb/Index-Section-Format.html Patch teaches dwarfdump tool to dump this section. Differential revision: https://reviews.llvm.org/D21503 llvm-svn: 282235
* Search for llvm-symbolizer binary in the same directory as argv[0], beforeRichard Smith2016-06-091-1/+1
| | | | | | | looking for it along $PATH. This allows installs of LLVM tools outside of $PATH to find the symbolizer and produce pretty backtraces if they crash. llvm-svn: 272232
* Apply most suggestions of clang-tidy's performance-unnecessary-value-paramBenjamin Kramer2016-06-081-1/+1
| | | | | | | Avoids unnecessary copies. All changes audited & pass tests with asan. No functional change intended. llvm-svn: 272190
OpenPOWER on IntegriCloud