aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
AgeCommit message (Collapse)AuthorFilesLines
2014-12-17Remove unused includes and out of date comment. NFC.Rafael Espindola1-1/+0
llvm-svn: 224413
2014-11-14Reapply "[dwarfdump] Add support for dumping accelerator tables."Frederic Riss1-0/+4
This reverts commit r221842 which was a revert of r221836 and of the test parts of r221837. This new version fixes an UB bug pointed out by David (along with addressing some other review comments), makes some dumping more resilient to broken input data and forces the accelerator tables to be dumped in the tests where we use them (this decision is platform specific otherwise). llvm-svn: 222003
2014-11-13Revert "[dwarfdump] Add support for dumping accelerator tables."Frederic Riss1-4/+0
This reverts commit r221836. The tests are asserting on some buildbots. This also reverts the test part of r221837 as it relies on dwarfdump dumping the accelerator tables. llvm-svn: 221842
2014-11-12[dwarfdump] Add support for dumping accelerator tables.Frederic Riss1-0/+4
The class used for the dump only allows to dump for the moment, but it can (and will) be easily extended to support search also. llvm-svn: 221836
2014-08-30Fix some cases where StringRef was being passed by const reference. Remove ↵Craig Topper1-1/+1
const from some other StringRefs since its implicitly const already. llvm-svn: 216820
2014-08-19Don't own the buffer in object::Binary.Rafael Espindola1-3/+4
Owning the buffer is somewhat inflexible. Some Binaries have sub Binaries (like Archive) and we had to create dummy buffers just to handle that. It is also a bad fit for IRObjectFile where the Module wants to own the buffer too. Keeping this ownership would make supporting IR inside native objects particularly painful. This patch focuses in lib/Object. If something elsewhere used to own an Binary, now it also owns a MemoryBuffer. This patch introduces a few new types. * MemoryBufferRef. This is just a pair of StringRefs for the data and name. This is to MemoryBuffer as StringRef is to std::string. * OwningBinary. A combination of Binary and a MemoryBuffer. This is needed for convenience functions that take a filename and return both the buffer and the Binary using that buffer. The C api now uses OwningBinary to avoid any change in semantics. I will start a new thread to see if we want to change it and how. llvm-svn: 216002
2014-08-01Remove some calls to std::move.Rafael Espindola1-3/+3
Instead of moving out the data in a ErrorOr<std::unique_ptr<Foo>>, get a reference to it. Thanks to David Blaikie for the suggestion. llvm-svn: 214516
2014-07-31Use a reference instead of a pointer.Rafael Espindola1-1/+1
This makes using a std::unique_ptr in the caller more convenient. llvm-svn: 214433
2014-07-31Use std::unique_ptr to make the ownership explicit.Rafael Espindola1-2/+3
llvm-svn: 214377
2014-07-06Update the MemoryBuffer API to use ErrorOr.Rafael Espindola1-4/+5
llvm-svn: 212405
2014-06-23Pass a std::unique_ptr& to the create??? methods is lib/Object.Rafael Espindola1-1/+1
This makes the buffer ownership on error conditions very natural. The buffer is only moved out of the argument if an object is constructed that now owns the buffer. llvm-svn: 211546
2014-06-13Remove 'using std::error_code' from tools.Rafael Espindola1-3/+2
llvm-svn: 210876
2014-06-12Don't use 'using std::error_code' in include/llvm.Rafael Espindola1-0/+1
This should make sure that most new uses use the std prefix. llvm-svn: 210835
2014-06-12Remove system_error.h.Rafael Espindola1-1/+1
This is a minimal change to remove the header. I will remove the occurrences of "using std::error_code" in a followup patch. llvm-svn: 210803
2014-05-19Kill symbolization functionality in llvm-dwarfdump. We have llvm-symbolizer ↵Alexey Samsonov1-48/+4
for that. llvm-svn: 209152
2014-05-15[DWARF parser] Use enums instead of bitfields in DILineInfoSpecifier.Alexey Samsonov1-6/+6
It is more appropriate than the current situation, when one flag (AbsoluteFilePath) is relevant only if another flag is set. This refactoring would also simplify fetching the short function name (stored in DW_AT_name) instead of a linkage name returned currently. No functionality change. llvm-svn: 208921
2014-04-18[DWARF parser] Turn DILineInfo into a struct.Alexey Samsonov1-4/+2
Immutable DILineInfo doesn't bring any benefits and complicates code. Also, use std::string instead of SmallString<16> for file and function names - their length can vary significantly. No functionality change. llvm-svn: 206654
2014-03-25DebugInfo: Support debug_loc under fissionDavid Blaikie1-0/+1
Implement debug_loc.dwo, as well as llvm-dwarfdump support for dumping this section. Outlined in the DWARF5 spec and http://gcc.gnu.org/wiki/DebugFission the debug_loc.dwo section has more variation than the standard debug_loc, allowing 3 different forms of entry (plus the end of list entry). GCC seems to, and Clang certainly, only use one form, so I've just implemented dumping support for that for now. It wasn't immediately obvious that there was a good refactoring to share the implementation of dumping support between debug_loc and debug_loc.dwo, so they're separate for now - ideas welcome or I may come back to it at some point. As per a comment in the code, we could choose different forms that may reduce the number of debug_addr entries we emit, but that will require further study. llvm-svn: 204697
2014-03-06Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles1-4/+3
This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
2014-03-05[C++11] Replace OwningPtr::take() with OwningPtr::release().Ahmed Charles1-1/+1
llvm-svn: 202957
2014-02-24llvm-dwarfdump: Support for debug_line.dwo section for file names for type ↵David Blaikie1-0/+1
units under fission. llvm-svn: 202091
2014-01-22Change createObjectFile to return an ErrorOr.Rafael Espindola1-3/+4
llvm-svn: 199776
2014-01-09llvm-dwarfdump: type unit dwo supportDavid Blaikie1-0/+1
llvm-svn: 198850
2013-11-19llvm-dwarfdump: support for emitting only the debug_types section using ↵David Blaikie1-0/+1
-debug-dump llvm-svn: 195063
2013-09-25Add gnu pubsections as options to llvm-dwarfdump.Eric Christopher1-0/+2
Argument spelling feedback welcome. llvm-svn: 191409
2013-09-25Dump the normal dwarf pubtypes section as well.Eric Christopher1-0/+1
llvm-svn: 191408
2013-06-19llvm-dwarfdump: Add support for dumping the .debug_loc sectionDavid Blaikie1-0/+1
This is a basic implementation - we still don't have any support (that I know of) for dumping DWARF expressions in a meaningful way, so the location information itself is just printed as a sequence of bytes as we do elsewhere. llvm-svn: 184361
2013-02-12Add support for the pubnames section to llvm-dwarfdump.Krzysztof Parzyszek1-0/+1
llvm-svn: 174976
2013-02-05Initial support for DWARF CFI parsing and dumping in LLVMEli Bendersky1-0/+1
llvm-svn: 174463
2013-01-25When encountering an unknown file format, ObjectFile::createObjectFile shouldEli Bendersky1-0/+5
politely report it instead of running into llvm_unreachable. Also patch llvm-dwarfdump to actually check whether the file it's attempting to dump is a valid object file. llvm-svn: 173489
2013-01-25Add command-line flags for DWARF dumping.Eli Bendersky1-1/+18
Flags for dumping specific DWARF sections added in lib/DebugInfo and llvm-dwarfdump. llvm-svn: 173480
2013-01-25Rename variable to be more comprehensible and follow naming conventionEli Bendersky1-4/+4
llvm-svn: 173460
2012-12-04Sort the #include lines for tools/...Chandler Carruth1-2/+2
Again, tools are trickier to pick the main module header for than library source files. I've started to follow the pattern of using LLVMContext.h when it is included as a stub for program source files. llvm-svn: 169252
2012-11-12Rewrite DIContext interface to take an object. Update all callers.Eric Christopher1-93/+1
llvm-svn: 167757
2012-11-12Fixup for r167558: Store raw pointer (instead of reference) to RelocMap in ↵Alexey Samsonov1-1/+1
DIContext. This is needed to prevent crashes because of dangling reference if the clients don't provide RelocMap to DIContext constructor. llvm-svn: 167728
2012-11-07Add a relocation visitor to lib object. This works via caching relocatedEric Christopher1-1/+58
values in a map that can be passed to consumers. Add a testcase that ensures this works for llvm-dwarfdump. llvm-svn: 167558
2012-10-16Formatting and 80-col.Eric Christopher1-3/+3
llvm-svn: 166075
2012-09-04Add support for fetching inlining context (stack of source code locations)Alexey Samsonov1-9/+32
by instruction address from DWARF. Add --inlining flag to llvm-dwarfdump to demonstrate and test this functionality, so that "llvm-dwarfdump --inlining --address=0x..." now works much like "addr2line -i 0x...", provided that the binary has debug info (Clang's -gline-tables-only *is* enough). llvm-svn: 163128
2012-08-27Add basic support for .debug_ranges section to LLVM's DebugInfo library.Alexey Samsonov1-1/+5
This section (introduced in DWARF-3) is used to define instruction address ranges for functions that are not contiguous and can't be described by low_pc/high_pc attributes (this is the usual case for inlined subroutines). The patch is the first step to support fetching complete inlining info from DWARF. Reviewed by Benjamin Kramer. llvm-svn: 162657
2012-07-19DebugInfo library: add support for fetching absolute paths to source filesAlexey Samsonov1-1/+2
(instead of basenames) from DWARF. Use this behavior in llvm-dwarfdump tool. Reviewed by Benjamin Kramer. llvm-svn: 160496
2012-07-02This patch extends the libLLVMDebugInfo which contains a minimalistic DWARF ↵Alexey Samsonov1-1/+12
parser: 1) DIContext is now able to return function name for a given instruction address (besides file/line info). 2) llvm-dwarfdump accepts flag --functions that prints the function name (if address is specified by --address flag). 3) test case that checks the basic functionality of llvm-dwarfdump added llvm-svn: 159512
2011-10-07Fix a few changes I missed.Michael J. Spencer1-3/+3
llvm-svn: 141392
2011-09-15llvm-dwarfdump: Add an option to print out line info for a specific addressBenjamin Kramer1-5/+15
Usage: $ llvm-dwarfdump -address=0x0000000100000ed4 a.out.dSYM/Contents/Resources/DWARF/a.out xxx.c:6:0 llvm-svn: 139850
2011-09-15DWARF: wire up .debug_str dumping.Benjamin Kramer1-1/+5
llvm-svn: 139799
2011-09-15DWARF: Add basic support for line tables.Benjamin Kramer1-1/+2
The llvm-dwarfdump output isn't very verbose yet. llvm-svn: 139771
2011-09-14llvm-dwarfdump: Make the "is debug info section" heuristic stricter so it ↵Benjamin Kramer1-4/+8
doesn't accidentaly picks up the wrong section. Also add some validation code to the aranges section parser. Fixes PR10926. llvm-svn: 139701
2011-09-14DWARF: Port support for parsing .debug_aranges section from LLDB and wire it ↵Benjamin Kramer1-1/+5
up to llvm-dwarfdump. This is only one half of it, the part that caches address ranges from the DIEs when .debug_aranges is not available will be ported soon. llvm-svn: 139680
2011-09-13Sketch out a DWARF parser.Benjamin Kramer1-0/+93
This introduces a new library to LLVM: libDebugInfo. It will provide debug information parsing to LLVM. Much of the design and some of the code is taken from the LLDB project. It also contains an llvm-dwarfdump tool that can dump the abbrevs and DIEs from an object file. It can be used to write tests for DWARF input and output easily. llvm-svn: 139627