aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp
AgeCommit message (Collapse)AuthorFilesLines
2015-01-06Implement a very basic colored syntax highlighting for llvm-dwarfdump.Adrian Prantl1-13/+19
The color scheme is the same as the one used by the colorize dwarfdump script on Darwin. A new --color option can be used to forcibly turn color on or off. http://reviews.llvm.org/D6852 llvm-svn: 225269
2014-12-19[DebugInfo] Move all DWARF headers to the public include directory.Frederic Riss1-4/+4
dsymutil needs access to DWARF specific inforamtion, the small DIContext wrapper isn't sufficient. Other DWARF consumers might want to use it too (I'm looking at you lldb). Differential Revision: http://reviews.llvm.org/D6694 llvm-svn: 224594
2014-12-15Silence more static analyzer warnings.Michael Ilseman1-1/+3
Add in definedness checks for shift operators, null checks when pointers are assumed by the code to be non-null, and explicit unreachables. llvm-svn: 224255
2014-10-23[dwarfdump] Dump DW_AT_ranges values inline in the debug_info dump.Frederic Riss1-1/+19
The output looks like that: DW_AT_ranges [FORM_data4] (0x00000000 [0x00000001000024a0 - 0x00000001000024c2) [0x0000000100002505 - 0x000000010000268b)) Differential Revision: http://reviews.llvm.org/D5712 llvm-svn: 220466
2014-10-10[dwarfdump] Prettyprint DW_AT_APPLE_property_attribute bitfield values.Frederic Riss1-0/+19
This change depends on the ApplePropertyString helper that I sent spearately. Not sure how you want this tested: as a tool test by adding a binary to dump, or as an llvm test starting from an IR file? Reviewers: dblaikie, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5689 llvm-svn: 219507
2014-10-10[dwarfdump] Resolve also variable specifications/abstract_origins.Frederic Riss1-8/+14
DW_AT_specification and DW_AT_abstract_origin resolving was only performed on subroutine DIEs because it used the getSubroutineName method. Introduce a more generic getName() and use it to dump the reference attributes. Testcases have been updated to check the printed names instead of the offsets except when the name could be ambiguous. Reviewers: dblaikie, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5625 llvm-svn: 219506
2014-10-06[dwarfdump] Print the name for referenced specification of abstract_origin DIEs.Frederic Riss1-0/+14
Reviewers: dblaikie, samsonov, echristo, aprantl Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5466 llvm-svn: 219099
2014-09-22[dwarfdump] Dump full filenames as DW_AT_(decl|call)_file attribute valuesFrederic Riss1-3/+13
Reviewers: dblaikie samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5192 llvm-svn: 218246
2014-09-22Allow DWARFDebugInfoEntryMinimal::getSubroutineName to resolve cross-unit ↵Frederic Riss1-4/+16
references. Summary: getSubroutineName is currently only used by llvm-symbolizer, thus add a binary test containing a cross-cu inlining example. Reviewers: samsonov, dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5394 llvm-svn: 218245
2014-09-05[dwarfdump] Dump DW_AT_(decl|call)_line attribute values as decimal values.Frederic Riss1-0/+2
llvm-svn: 217232
2014-09-04[ dwarfdump ] Add symbolic dump of known DWARF attribute values.Frederic Riss1-1/+11
Reviewed By: dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5187 llvm-svn: 217186
2014-06-13[DWARF parser] Use distinction between DW_AT_ranges_base and ↵Alexey Samsonov1-0/+10
DW_AT_GNU_ranges_base instead of DWARF version llvm-svn: 210945
2014-05-17[DWARF parser] Teach DIContext to fetch short (non-linkage) function names ↵Alexey Samsonov1-7/+9
for a given address. Change --functions option in llvm-symbolizer tool to accept values "none", "short" or "linkage". Update the tests and docs accordingly. llvm-svn: 209050
2014-05-15[DWARF parser] Use enums instead of bitfields in DILineInfoSpecifier.Alexey Samsonov1-4/+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-18DebugInfo: Remove some initializer lists to make MSVC happy again.Benjamin Kramer1-3/+3
llvm-svn: 206632
2014-04-18[DWARF parser] Refactor fetching DIE address ranges.Alexey Samsonov1-26/+34
Add a helper method to get address ranges specified in a DIE (either by DW_AT_low_pc/DW_AT_high_pc, or by DW_AT_ranges). Use it to untangle and simplify the code. No functionality change. llvm-svn: 206624
2014-04-15[C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper1-7/+8
instead of comparing to nullptr. llvm-svn: 206252
2014-03-13[C++11] Convert DWARF parser to range-based for loopsAlexey Samsonov1-7/+4
llvm-svn: 203766
2013-10-28Merge DWARFDIE::extractFast and DWARFDIE::extract into one function.Alexey Samsonov1-50/+10
Complicated CU-DIE-specific logic in the latter was never used, and it makes sense to have safety checks for broken dwarf in the former. llvm-svn: 193563
2013-10-28DWARF parser: Use ArrayRef to represent form sizes and simplify ↵Alexey Samsonov1-8/+5
DWARFDIE::extractFast() interface. No functionality change. llvm-svn: 193560
2013-10-28DWARF parser: since DWARF4, DW_AT_high_pc may be a constant representing ↵Alexey Samsonov1-4/+10
function size llvm-svn: 193555
2013-10-28DebugInfo: Introduce the notion of "form classes"Alexey Samsonov1-19/+36
Summary: Use DWARF4 table of form classes to fetch attributes from DIE in a more consistent way. This shouldn't change the functionality and serves as a refactoring for upcoming change: DW_AT_high_pc has different semantics depending on its form class. Reviewers: dblaikie, echristo Reviewed By: echristo CC: echristo, llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1961 llvm-svn: 193553
2013-10-17[DebugInfo] Delete dead code, simplify and fix code style for some existing ↵Alexey Samsonov1-37/+23
code. No functionality change. llvm-svn: 192894
2013-09-23Exract most of DWARFCompileUnit into a new DWARFUnit to prepare for the ↵David Blaikie1-100/+77
coming DWARFTypeUnit. llvm-svn: 191233
2013-08-27Add support for DebugFission to DWARF parserAlexey Samsonov1-31/+32
Summary: 1) Make llvm-symbolizer properly symbolize files with split debug info (by using stanalone .dwo files). 2) Make DWARFCompileUnit parse and store corresponding .dwo file, if necessary. 3) Make bits of DWARF parsing more CompileUnit-oriented. Reviewers: echristo Reviewed By: echristo CC: bkramer, llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1164 llvm-svn: 189329
2013-08-19llvm-dwarfdump: Do not include address offsets for attributes, only for tagsDavid Blaikie1-1/+1
This reduces the noise in diffs making it more likely that, at least for LLVM revision-over-revision, diffs will actually yield usable results. This is consistent with objdump's DWARF dumping behavior. llvm-svn: 188650
2013-08-06Store compile unit corresponding to each chain of inlined debug info ↵Alexey Samsonov1-7/+6
entries. No functionality change. llvm-svn: 187792
2013-04-17Create a stub for DWARF parser unittestsAlexey Samsonov1-1/+1
Moves one DWARF-specific header to include/llvm/DebugInfo from lib/. Add a short unittest for r179095. llvm-svn: 179678
2013-04-08DWARF parser: remove duplicated code and fix code style in DIE extractors.Alexey Samsonov1-265/+73
llvm-svn: 179023
2013-01-17Fix the assembly and dissassembly of DW_FORM_sec_offset. Found this byEric Christopher1-8/+4
changing both the string of the dwo_name to be correct and the type of the statement list. Testcases all around. llvm-svn: 172699
2013-01-07Add support for separating strings for the split debug info DWARF5Eric Christopher1-2/+11
proposal. This leaves the strings in the skeleton die as strp, but in all dwo files they're accessed now via DW_FORM_GNU_str_index. Add support for dumping these sections and modify the fission-cu.ll testcase to have the correct strings and form. Fix a small bug in the fixed form sizes routine that involved out of array accesses for the table and add a FIXME in the extractFast routine to fix this up. llvm-svn: 171779
2013-01-07Update comment.Eric Christopher1-1/+1
llvm-svn: 171689
2013-01-02Extend the dumping infrastructure to deal with additionalEric Christopher1-2/+1
sections for debug info. These are some of the dwo sections from the DWARF5 split debug info proposal. Update the fission-cu.ll testcase to show what we should be able to dump more of now. Work in progress: Ultimately the relocations will be gone for the dwo section and the strings will be a different form (as well as the rest of the sections will be included). llvm-svn: 171428
2012-10-30Reformat and 80-column this. It's not strictly conformingEric Christopher1-21/+29
yet, but it's better. llvm-svn: 167053
2012-09-04Add support for fetching inlining context (stack of source code locations)Alexey Samsonov1-32/+88
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-24Add support for some missing DW_FORM_*.Eric Christopher1-0/+28
TODO: Fix code duplication and coding style. llvm-svn: 162525
2012-08-24Formatting.Eric Christopher1-1/+1
llvm-svn: 162524
2012-08-2380-col.Eric Christopher1-1/+1
llvm-svn: 162422
2012-07-17Improve behavior of DebugInfoEntryMinimal::getSubprogramName() introduced in ↵Alexey Samsonov1-24/+27
r159512. To fetch a subprogram name we should not only inspect the DIE for this subprogram, but optionally inspect its specification, or its abstract origin (even if there is no inlining), or even specification of an abstract origin. Reviewed by Benjamin Kramer. llvm-svn: 160365
2012-07-02This patch extends the libLLVMDebugInfo which contains a minimalistic DWARF ↵Alexey Samsonov1-0/+48
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
2012-01-20More dead code removal (using -Wunreachable-code)David Blaikie1-2/+0
llvm-svn: 148578
2011-11-05Reduce the offsets in DwarfDebugInfoEntry to 32 bit, they're printed with %x andBenjamin Kramer1-1/+1
that breaks on big-endian machines. I have to clean up the 32/64 bit confusion in libDebugInfo some day. llvm-svn: 143812
2011-09-15DWARF: wire up .debug_str dumping.Benjamin Kramer1-1/+1
llvm-svn: 139799
2011-09-15DWARF: Make DIE printing more bulletproof.Benjamin Kramer1-5/+18
llvm-svn: 139786
2011-09-14DWARF: Generate the address lookup table from the DIE tree if .debug_aranges ↵Benjamin Kramer1-1/+25
is not available. Ported from LLDB. llvm-svn: 139732
2011-09-14DWARF: Improve indentation of DIE dumping so it's easier to see the structure.Benjamin Kramer1-8/+8
llvm-svn: 139705
2011-09-14DebugInfo: Don't print DIEs multiple times.Benjamin Kramer1-3/+1
llvm-svn: 139671
2011-09-13Style & indentation tweaks.Benjamin Kramer1-2/+1
llvm-svn: 139646
2011-09-13Sketch out a DWARF parser.Benjamin Kramer1-0/+410
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