summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/dsymutil
Commit message (Collapse)AuthorAgeFilesLines
...
* [dsymutil] Add function size to the debug map.Frederic Riss2015-03-151-22/+22
| | | | | | | | | | | | 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-143-2/+36
| | | | | | | | 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-143-0/+26
| | | | | | | | 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] Implement DW_AT_ranges linking.Frederic Riss2015-03-132-1/+7
| | | | | | | 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] Fix handling of cross-cu forward references.Frederic Riss2015-03-131-2/+5
| | | | | | | | | | 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-133-0/+12
| | | | | | | 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-133-0/+94
| | | | | | | | 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
* [dsymutil] Correctly clone address attributes.Frederic Riss2015-03-112-0/+12
| | | | | | | 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
* [dsymutil] Apply relocations to DIE data before cloning.Frederic Riss2015-03-072-2/+18
| | | | | | | | | | | | | 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-062-0/+35
| | | | | | | | | | 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] Add debug_str construction support.Frederic Riss2015-03-062-2/+49
| | | | | | With this comes the ability to correctly clone string attributes in DIEs. llvm-svn: 231493
* [dsymutil] Add minimal code to emit DIE trees.Frederic Riss2015-03-042-0/+126
| | | | | | | | | | | | | | | | | | | 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] Add the DwarfStreamer class.Frederic Riss2015-02-283-3/+13
| | | | | | | | | | | | | | | | | | | | 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 DIE selection algorithm.Frederic Riss2015-02-131-1/+96
| | | | | | | | | | | | | | | | 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] Add DwarfLinker class.Frederic Riss2015-01-281-0/+54
| | | | | | | | It's an empty shell for now. It's main method just opens the debug map objects and parses their Dwarf info. Test that we at least do that correctly. llvm-svn: 227337
* [dsymutil] Add the detected target triple to the debug map.Frederic Riss2015-01-191-3/+5
| | | | | | | It will be needed to instantiate the Target object that we will use to create all the MC objects for the dwarf emission. llvm-svn: 226525
* [dsymutil] Implement the BinaryHolder object and gain archive support.Frederic Riss2015-01-054-0/+32
| | | | | | | | | | | | | | | | | | | This object is meant to own the ObjectFiles and their underlying MemoryBuffer. It is basically the equivalent of an OwningBinary except that it efficiently handles Archives. It is optimized for efficiently providing mappings of members of the same archive when they are opened successively (which is standard in Darwin debug maps, objects from the same archive will be contiguous). Of course, the BinaryHolder will also be used by the DWARF linker once it is commited, but for now only the debug map parser uses it. With this change, you can run llvm-dsymutil on your Darwin debug build of clang and get a complete debug map for it. Differential Revision: http://reviews.llvm.org/D6690 llvm-svn: 225207
* Relax debug-map-parsing.test error message check for WindowsReid Kleckner2014-12-121-4/+4
| | | | | | On Windows we get the string "no such file or directory". llvm-svn: 224141
* Initial dsymutil tool commit.Frederic Riss2014-12-1210-0/+115
| | | | | | | | | | | | | | | | | | | | | | | | The goal of this tool is to replicate Darwin's dsymutil functionality based on LLVM. dsymutil is a DWARF linker. Darwin's linker (ld64) does not link the debug information, it leaves it in the object files in relocatable form, but embbeds a `debug map` into the executable that describes where to find the debug information and how to relocate it. When releasing/archiving a binary, dsymutil is called to link all the DWARF information into a `dsym bundle` that can distributed/stored along with the binary. With this commit, the LLVM based dsymutil is just able to parse the STABS debug maps embedded by ld64 in linked binaries (and not all of them, for example archives aren't supported yet). Note that the tool directory is called dsymutil, but the executable is currently called llvm-dsymutil. This discrepancy will disappear once the tool will be feature complete. At this point the executable will be renamed to dsymutil, but until then you do not want it to override the system one. Differential Revision: http://reviews.llvm.org/D6242 llvm-svn: 224134
* Revert "Initial dsymutil tool commit."Frederic Riss2014-12-0910-115/+0
| | | | | | This reverts commit r223793. The review thread wasn't concluded. llvm-svn: 223794
* Initial dsymutil tool commit.Frederic Riss2014-12-0910-0/+115
The goal of this tool is to replicate Darwin's dsymutil functionality based on LLVM. dsymutil is a DWARF linker. Darwin's linker (ld64) does not link the debug information, it leaves it in the object files in relocatable form, but embbeds a `debug map` into the executable that describes where to find the debug information and how to relocate it. When releasing/archiving a binary, dsymutil is called to link all the DWARF information into a `dsym bundle` that can distributed/stored along with the binary. With this commit, the LLVM based dsymutil is just able to parse the STABS debug maps embedded by ld64 in linked binaries (and not all of them, for example archives aren't supported yet). Note that the tool directory is called dsymutil, but the executable is currently called llvm-dsymutil. This discrepancy will disappear once the tool will be feature complete. At this point the executable will be renamed to dsymutil, but until then you do not want it to override the system one. Differential Revision: http://reviews.llvm.org/D6242 llvm-svn: 223793
OpenPOWER on IntegriCloud