summaryrefslogtreecommitdiffstats
path: root/llvm/tools/dsymutil
Commit message (Collapse)AuthorAgeFilesLines
...
* Switch two simple uses of GetTempSymbol to createTempSymbol.Rafael Espindola2015-03-171-2/+2
| | | | llvm-svn: 232484
* Pass in a "const Triple &T" instead of a raw StringRef.Rafael Espindola2015-03-161-1/+1
| | | | llvm-svn: 232429
* [dsymutil] Add support to generate .debug_pubnames and .debug_pubtypesFrederic Riss2015-03-161-3/+208
| | | | | | | | The information gathering part of the patch stores a bit more information than what is strictly necessary for these 2 sections. The rest will become useful when we start emitting __apple_* type accelerator tables. llvm-svn: 232342
* [dsymutil] Add missing raw_svector_stream::resync() calls.Frederic Riss2015-03-151-3/+4
| | | | | | | | | Also, after looking at the raw_svector_stream internals, increase the size of the SmallString used with it to prevent heap allocation. Issue found by the Asan bot. llvm-svn: 232335
* [dsymutil] Add support for linking line tables.Frederic Riss2015-03-151-4/+373
| | | | | | | | | | | | | | | This code comes with a lot of cruft that is meant to mimic darwin's dsymutil behavior. A much simpler approach (described in the numerous FIXMEs that I put in there) gives the right output for the vast majority of cases. The extra corner cases that are handled differently need to be investigated: they seem to correctly handle debug info that is in the input, but that info looks suspicious in the first place. Anyway, the current code needs to handle this, but I plan to revisit it as soon as the big round of validation against the classic dsymutil is over. llvm-svn: 232333
* [dsymutil] Add an way to iterate over a DebugMapObject symbols.Frederic Riss2015-03-151-0/+4
| | | | llvm-svn: 232305
* [dsymutil] Add function size to the debug map.Frederic Riss2015-03-153-12/+27
| | | | | | | | | | | | The debug map embedded by ld64 in binaries conatins function sizes. These sizes are less precise than the ones given by the debug information (byte granularity vs linker atom granularity), but they might cover code that is referenced in the line table but not in the DIE tree (that might very well be a compiler bug that I need to investigate later). Anyway, extracting that information is necessary to be able to mimic dsymutil's behavior exactly. llvm-svn: 232300
* [dsymutil] Add support for debug_loc section.Frederic Riss2015-03-141-3/+91
| | | | | | | | There is no need to look into the location expressions to transfer them, the only modification to apply is to patch their base address to reflect the linked function address. llvm-svn: 232267
* [dsymutil] Generate debug_aranges section.Frederic Riss2015-03-141-19/+67
| | | | | | | | This actually shares most of its implementation with the generation of the debug_ranges (the absence of 'a' is not a typo) contribution for the unit's DW_AT_ranges attribute. llvm-svn: 232246
* [dsymutil] Identify each CompileUnit with a unique ID.Frederic Riss2015-03-141-4/+8
| | | | | | | | | | The ID can eg. de used in MCSymbol names to differentiate the ones that need to be created for every unit. The ID is a constructor parameter and not a static class member so there is no issue with counter updates if we decide to thread that code. llvm-svn: 232245
* [dsymutil] Fix typo in comment.Frederic Riss2015-03-131-1/+1
| | | | | | | | Next time, when I fix a typo, I'll take the time to reread the whole comment instead of waiting for the commit email to realize that there is another one two words later... llvm-svn: 232234
* [dsymutil] Fix typo in doxygen comment.Frederic Riss2015-03-131-1/+1
| | | | llvm-svn: 232233
* [dsymutil] Implement DW_AT_ranges linking.Frederic Riss2015-03-131-10/+197
| | | | | | | Nothing fancy, just a straightforward offset to apply to the original debug_ranges entries to get them in line with the linked addresses. llvm-svn: 232232
* [dsymutil] Move a function declaration closer to its peers.Frederic Riss2015-03-131-1/+1
| | | | llvm-svn: 232231
* [dsymutil] Fix handling of cross-cu forward references.Frederic Riss2015-03-131-20/+30
| | | | | | | | | | We recorded the forward references in the CU that holds the referenced DIE, but this is wrong as those will get resoled *after* the CU that holds the reference. Record the references in their originating CU along with a pointer to the remote CU to be able to compute the fixed up offset at the right time. llvm-svn: 232193
* [dsymutil] Add relocation of compile_units low_pc/high_pc.Frederic Riss2015-03-131-16/+43
| | | | | | | They need to be handled specifically as they could vary pretty widely depending on how the linker moves functions around. llvm-svn: 232192
* [dsymutil] Fix location cloning for newer dwarf versions.Frederic Riss2015-03-131-1/+1
| | | | | | | | The typo got unnoticed because we were testing only on Dwarf 2. Add a Dwarf4 test that exercises the code path, and also tests some newer FORMs that the other test doesn't cover. llvm-svn: 232191
* Reapply "[dsymutil] Gather function ranges during DIE selection."Frederic Riss2015-03-121-4/+47
| | | | | | | | This reverts commit r231967 which reinstates r231957. Now that IntervalMap uses explicitely aligned storage, it should be safe. llvm-svn: 232080
* Revert "[dsymutil] Gather function ranges during DIE selection."Frederic Riss2015-03-111-47/+4
| | | | | | | | | | | | This reverts commit r231957. IntervalMap currently doesn't support keys more aligned than host pointers and I've been using it with uint64_t keys. This asserts on some 32bits systems. Revert while I work on an IntervalMap generalization. llvm-svn: 231967
* [dsymutil] Add missing headers.Frederic Riss2015-03-111-0/+2
| | | | | | No build failure, found by code inspection. llvm-svn: 231958
* [dsymutil] Gather function ranges during DIE selection.Frederic Riss2015-03-111-4/+47
| | | | | | | | | | | | | Gather the function ranges [low_pc, high_pc) during DIE selection and store them along with the offset to apply to them to get the linked addresses. This is just the data collection part, it comes with no tests. That information will be used in multiple followup commits to perform the relocation of line tables and range sections among other things, and these commits will add tests. llvm-svn: 231957
* [dsymutil] Small clang-format patch.Frederic Riss2015-03-111-2/+2
| | | | llvm-svn: 231956
* [dsymutil] Correctly clone address attributes.Frederic Riss2015-03-111-14/+73
| | | | | | | DW_AT_low_pc on functions is taken care of by the relocation processing, but DW_AT_high_pc and DW_AT_low_pc on other lexical scopes need special handling. llvm-svn: 231955
* Remove the use of the subtarget in MCCodeEmitter creation andEric Christopher2015-03-101-1/+1
| | | | | | | update all ports accordingly. Required a couple of small rewrites in handling subtarget features during creation in PPC. llvm-svn: 231861
* Adding parenthesis around logical expressions to silence a -Wparentheses ↵Aaron Ballman2015-03-071-2/+2
| | | | | | warning; NFC. llvm-svn: 231567
* Removing spurious semi-colons; NFCAaron Ballman2015-03-071-2/+2
| | | | llvm-svn: 231566
* [dsymutil] Apply relocations to DIE data before cloning.Frederic Riss2015-03-071-1/+68
| | | | | | | | | | | | | Doing this gets function's low_pc and global variable's locations right in the output debug info. It also could get right other attributes that need to be relocated (in linker terms), but I don't know of any other than the address attributes. This doesn't fixup low_pc attributes in compile_unit, lexical_block or inlined subroutine, nor does it get right high_pc attributes for function. This will come in a subsequent commit. llvm-svn: 231544
* [dsymutil] Support cloning DIE reference attributes.Frederic Riss2015-03-061-10/+96
| | | | | | | | | | Reference attributes are mainly handled by just creating DIEEntry attributes for them. There is a special case for DW_FORM_ref_addr attributes though, because the DIEEntry code needs a DwarfDebug code to emit them (and we don't have one as we do no CodeGen). In that case, just use DIEInteger attributes with the right form. llvm-svn: 231531
* [dsymutil] Set linked unit start offset early. NFC.Frederic Riss2015-03-061-7/+8
| | | | | | | | | | The start offset of a linked unit is known before starting to clone its DIEs. Handling DW_FORM_ref_addr attributes requires that this offset is set while cloning the unit. Split CompileUnit::computeOffsets() into setStartOffset() and computeNextUnitOffset() and call them repsectively before cloning the DIEs and right after. llvm-svn: 231530
* [dsymutil] Add debug_str construction support.Frederic Riss2015-03-061-6/+112
| | | | | | With this comes the ability to correctly clone string attributes in DIEs. llvm-svn: 231493
* Revert "[dsymutil] MSVC does generate move constructors, but it should ↵Frederic Riss2015-03-051-1/+4
| | | | | | | | | | | accept to default them" This reverts commit r231350. It turns out MSVC doesn't generate implicit move constructors and also doesn't accept to default them... See for example http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc/builds/2786 llvm-svn: 231351
* [dsymutil] MSVC does generate move constructors, but it should accept to ↵Frederic Riss2015-03-051-4/+1
| | | | | | default them llvm-svn: 231350
* Provide an explicit move ctor because MSVC can't synthesize oneDavid Blaikie2015-03-041-0/+6
| | | | llvm-svn: 231303
* [dsymutil] Add minimal code to emit DIE trees.Frederic Riss2015-03-041-4/+427
| | | | | | | | | | | | | | | | | | | This commit adds code to emit DIE trees that have been pruned from the parts that haven't been marked as kept in the previous pass. It works by 'cloning' the input DIE tree (as read by libDebugInfoDwarf) into a tree of DIE objects. Cloning the DIEs means essentially cloning their attributes. The code in this commit does only handle scalar and block attributes (scalar because they are trivial, blocks because they can't be easily replaced by a scalr placeholder), all the other ones are replaced by placeholder zero values and will be handled in further commits. The added tests mostly check that the DIE tree has the correct layout and also verify that a few chosen scalar and block attributes correctly make their way into the output. llvm-svn: 231300
* [dsymutil] Fully qualify llvm::make_unique<>.Frederic Riss2015-02-281-2/+3
| | | | llvm-svn: 230826
* [dsymutil] Add the DwarfStreamer class.Frederic Riss2015-02-286-6/+156
| | | | | | | | | | | | | | | | | | | | This class is responsible for getting the linked data to the disk in the appropriate form. Today it it an empty shell that just instantiates an MC layer. As we do not put anything in the resulting file yet, we just check it has the right architecture (and check that -o does the right thing). To be able to create all the components, this commit adds a few dependencies to llvm-dsymutil, namely all-targets, MC and AsmPrinter. Also add a -no-output option, so that tests that do not need the binary result can continue to run even if they do not have the required target linked in. llvm-svn: 230824
* [dsymutil] Add a LinkOptions struct to pass to the DwarfLinker. NFC.Frederic Riss2015-02-283-14/+26
| | | | | | | The only option we have to pass down currently is verbosity, but there are more to come. llvm-svn: 230823
* [dsymutil] clang-format a fileFrederic Riss2015-02-281-3/+2
| | | | llvm-svn: 230822
* [dsymutil] Add -o option to select ouptut filenameFrederic Riss2015-02-281-4/+14
| | | | | | We do not create the output file yet, so no means to test. llvm-svn: 230821
* [dsymutil] Create warn() global helper...Frederic Riss2015-02-281-3/+8
| | | | | | | | | ...and reimplement DwarfLinker::reportWarning in terms of it. Other compenents than the DwarfLinker will need to report warnings, and I'm about to add a similar "error()" helper at the same global level so make that consistent. llvm-svn: 230820
* [dsymutil] Make trivial accessor const.Frederic Riss2015-02-281-1/+1
| | | | llvm-svn: 230819
* [dsymutil] Add DIE selection algorithm.Frederic Riss2015-02-131-1/+320
| | | | | | | | | | | | | | | | With this commit, llvm-dsymutil learns how to choose which DIEs it will link in the final output and which ones it won't. This is based on the 'valid relocation' information that has been built in the previous commits. The test only tests that we choose the right 'root DIEs'. The selection algorithm (and especially the part that walk the dependencies of a root DIE) lacks a bit test coverage. This will be much easier to cover when we output actual Dwarf and thus can use llvm-dwarfdump to verify the structure of the emitted DIE trees. I'll add more tests then. llvm-svn: 229183
* [dsymutil] Downcase a function name.Frederic Riss2015-02-131-4/+4
| | | | llvm-svn: 229182
* [dsymutil] Add a few generic helper methods.Frederic Riss2015-02-131-5/+71
| | | | | | | To be used in subsequent commits (separated to keep only core logic in the follow-ups). llvm-svn: 229181
* [dsymutil] constify trivial function.Frederic Riss2015-02-131-1/+1
| | | | llvm-svn: 229180
* [dsymutil] Find relocations that correspond to debug map entries.Frederic Riss2015-02-131-1/+148
| | | | | | | | These 'valid relocations' in the debug_info section will be how dsymutil identifies the DIEs it needs to keep in the linked debug information. llvm-svn: 229178
* [dsymutil] Add DebugMapObject::lookupObjectAddress()Frederic Riss2015-02-132-3/+22
| | | | | | | It turns out the debug map will be interogated both by name and by object file address. Add the latter capability. llvm-svn: 229177
* Re-sort #include lines using my handy dandy ./utils/sort_includes.pyChandler Carruth2015-02-131-1/+0
| | | | | | script. This is in preparation for changes to lots of include lines. llvm-svn: 229088
* Move DebugInfo to DebugInfo/DWARF.Zachary Turner2015-01-304-5/+5
| | | | | | | | | | | | | In preparation for adding PDB support to LLVM, this moves the DWARF parsing code to its own subdirectory under DebugInfo, and renames LLVMDebugInfo to LLVMDebugInfoDWARF. This is purely a mechanical / build system change. Differential Revision: http://reviews.llvm.org/D7269 Reviewed by: Eric Christopher llvm-svn: 227586
* [dsymutil] Gather the DIE tree child->parent relationships.Frederic Riss2015-01-281-0/+62
| | | | | | | | | | The libDebugInfo DIE parsing doesn't store these relationships, we have to recompute them. This commit introduces the CompileUnit bookkeeping class to store this data. It will be expanded with more fields in the future. No tests as this produces no visible output. llvm-svn: 227382
OpenPOWER on IntegriCloud