summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-195-7/+7
| | | | | | | | | | | | | The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
* [DWARF] Fix a bug in line info handlingKeno Fischer2015-05-311-62/+43
| | | | | | | | | | | | | | | | | | | | This fixes a bug in the line info handling in the dwarf code, based on a problem I when implementing RelocVisitor support for MachO. Since addr+size will give the first address past the end of the function, we need to back up one line table entry. Fix this by looking up the end_addr-1, which is the last address in the range. Note that this also removes a duplicate output from the llvm-rtdyld line table dump. The relevant line is the end_sequence one in the line table and has an offset of the first address part the end of the range and hence should not be included. Also factor out the common functionality into a separate function. This comes up on MachO much more than on ELF, since MachO doesn't store the symbol size separately, hence making said situation always occur. Differential Revision: http://reviews.llvm.org/D9925 llvm-svn: 238699
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-291-2/+2
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238602
* DebugInfo: .debug_line DWARF64 supportEd Maste2015-05-281-9/+18
| | | | | | | | | | | This adds support for the 64-bit DWARF format, but is still limited to less than 4GB of debug data by the DataExtractor class. Some versions of the GNU MIPS toolchain generate 64-Bit DWARF even though it isn't actually necessary. Differential Revision: http://reviews.llvm.org/D1988 llvm-svn: 238434
* Refactor: Simplify boolean conditional return statements in ↵Benjamin Kramer2015-05-252-8/+3
| | | | | | | | | | | llvm/lib/DebugInfo/DWARF Use clang-tidy to simplify boolean conditional return statements. Patch by Richard Thomson <legalize@xmission.com>! Differential Revision: http://reviews.llvm.org/D9972 llvm-svn: 238132
* Make it easier to use DwarfContext with MCJITKeno Fischer2015-05-211-3/+41
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This supersedes http://reviews.llvm.org/D4010, hopefully properly dealing with the JIT case and also adds an actual test case. DwarfContext was basically already usable for the JIT (and back when we were overwriting ELF files it actually worked out of the box by accident), but in order to resolve relocations correctly it needs to know the load address of the section. Rather than trying to get this out of the ObjectFile or requiring the user to create a new ObjectFile just to get some debug info, this adds the capability to pass in that info directly. As part of this I separated out part of the LoadedObjectInfo struct from RuntimeDyld, since it is now required at a higher layer. Reviewers: lhames, echristo Reviewed By: echristo Subscribers: vtjnash, friss, rafael, llvm-commits Differential Revision: http://reviews.llvm.org/D6961 llvm-svn: 237961
* [DWARF parser] Make DWARF parser more robust against missing compile/type units.Alexey Samsonov2015-05-194-16/+24
| | | | | | | | | | | | | | | | | | DWARF standard claims that each compilation/type unit header in .debug_info/.debug_types section must be followed by corresponding compile/type unit DIE, possibly with its children. Two situations are possible: * compile/type unit DIE is missing because DWARF producer failed to emit it. * DWARF parser failed to parse unit DIE correctly, for instance if it contains some unsupported attributes (see r237721, for instance). In either of these cases, the library, and the tools that use it (llvm-dwarfdump, llvm-symbolizer) should not crash. Insert appropriate checks to protect against this. llvm-svn: 237733
* [DWARF parser] Add basic support for DWZ DWARF multifile extensions.Alexey Samsonov2015-05-192-43/+51
| | | | | | | | | | | | | | | | | | | | | This change implements basic support for DWARF alternate sections proposal: http://www.dwarfstd.org/ShowIssue.php?issue=120604.1&type=open LLVM tools now understand new forms: DW_FORM_GNU_ref_alt and DW_FORM_GNU_strp_alt, which are used as references to .debug_info and .debug_str sections respectively, stored in a separate file, and possibly shared between different executables / shared objects. llvm-dwarfdump and llvm-symbolizer don't yet know how to access this alternate debug file (usually pointed by .gnu_debugaltlink section), but they can at lease properly parse and dump regular files, which refer to it. This change should fix crashes of llvm-dwarfdump and llvm-symbolizer on files produced by running "dwz" tool. Such files are already installed on some modern Linux distributions. llvm-svn: 237721
* MC: MCCodeGenInfo naming update. NFC.Jim Grosbach2015-05-152-2/+2
| | | | | | s/InitMCCodeGenInfo/initMCCodeGenInfo/ llvm-svn: 237471
* [DWARF] Add CIE header fields address_size and segment_size when generating ↵Keith Walker2015-05-121-7/+18
| | | | | | | | | | | | | dwarf-4 The DWARF-4 specification added 2 new fields in the CIE header called address_size and segment_size. Create these 2 new fields when generating dwarf-4 CIE entries, print out the new fields when dumping the CIE and update tests Differential Revision: http://reviews.llvm.org/D9558 llvm-svn: 237145
* A few fixes for llvm-symbolizer on Windows.Zachary Turner2015-05-061-20/+50
| | | | | | | | | Specifically, this patch correctly respects the -demangle option, and additionally adds a hidden --relative-address option allows input addresses to be relative to the module load address instead of absolute addresses into the image. llvm-svn: 236653
* Fix build.Zachary Turner2015-05-011-1/+1
| | | | llvm-svn: 236343
* [llvm-pdbdump] Support dynamic load address and external symbols.Zachary Turner2015-05-011-3/+11
| | | | | | | | | | | This patch adds the --load-address command line option to llvm-pdbdump, which dumps all addresses assuming the module has loaded at the specified address. Additionally, this patch adds an option to llvm-pdbdump to support dumping of public symbols (i.e. symbols with external linkage). llvm-svn: 236342
* Add missing library dependency in libPDB.Pete Cooper2015-04-271-1/+1
| | | | | | | | PDB uses COFFObjectFile::getPE32Header which lives in libObject. Make sure that LLVMBuild.txt reflects this dependency. llvm-svn: 235920
* Make llvm-symbolizer work on Windows.Zachary Turner2015-04-272-0/+104
| | | | | | | Differential Revision: http://reviews.llvm.org/D9234 Reviewed By: Alexey Samsonov llvm-svn: 235900
* Move DIContext.h to common DebugInfo location.Zachary Turner2015-04-233-20/+2
| | | | | | | | | | This will enable us to create a PDBContext so as to expose some amount of debug info functionality through a common interace. Differential Revision: http://reviews.llvm.org/D9205 Reviewed by: Alexey Samsonov llvm-svn: 235612
* [PDB] Support executables and source/line info.Zachary Turner2015-04-172-2/+74
| | | | | | | | | | | | Previously DebugInfoPDB could only load data for a PDB given a path to the PDB. It could not open an EXE and find the matching PDB and verify it matched, etc. This patch adds support for that so that we can simply load debug information for a PDB directly. Additionally, this patch extends DebugInfoPDB to support getting source and line information for symbols. llvm-svn: 235237
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-113-14/+15
| | | | | | | | | | | | | | The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' \ -j=32 -fix -format http://reviews.llvm.org/D8925 llvm-svn: 234679
* Raising minimum required CMake version to 2.8.12.2.Chris Bieneman2015-03-231-1/+1
| | | | | | This commit is in reference to the llvm-dev thread: http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/083672.html llvm-svn: 233008
* Purge unused includes throughout libSupport.Benjamin Kramer2015-03-231-0/+1
| | | | | | NFC. llvm-svn: 232976
* DWARFFormValue: Add getAsSignedConstant method.Frederic Riss2015-03-041-0/+19
| | | | | | | The implementation accepts explicitely signed forms (DW_FORM_sdata), but also unsigned forms as long as they fit in an int64_t. llvm-svn: 231299
* [llvm-pdbdump] Display full enum definitions.Zachary Turner2015-03-042-2/+14
| | | | | | | | | | | This will now display enum definitions both at the global scope as well as nested inside of classes. Additionally, it will no longer display enums at the global scope if the enum is nested. Instead, it will omit the definition of the enum globally and instead emit it in the corresponding class definition. llvm-svn: 231215
* [llvm-pdbdump] Many minor fixes and improvementsZachary Turner2015-03-021-1/+19
| | | | | | | | | | | | | | | | | A short list of some of the improvements: 1) Now supports -all command line argument, which implies many other command line arguments to simplify usage. 2) Now supports -no-compiler-generated command line argument to exclude compiler generated types. 3) Prints base class list. 4) -class-definitions implies -types. 5) Proper display of bitfields. 6) Can now distinguish between struct/class/interface/union. And a few other minor tweaks. llvm-svn: 230933
* [llvm-pdbdump] Clean up method signatures.Zachary Turner2015-03-0132-165/+83
| | | | llvm-svn: 230889
* [llvm-pdbdump] Better error handling.Zachary Turner2015-02-282-18/+35
| | | | | | | | | | | | | Previously it was impossible to distinguish between "There is no PDB implementation for this platform" and "I tried to load the PDB, but couldn't find the file", making it hard to figure out if you built llvm-pdbdump incorrectly or if you just mistyped a file name. This patch adds proper error handling so that we can know exactly what went wrong. llvm-svn: 230868
* Replace std::copy with a back inserter with vector append where feasibleBenjamin Kramer2015-02-281-2/+1
| | | | | | | | | All of the cases were just appending from random access iterators to a vector. Using insert/append can grow the vector to the perfect size directly and moves the growing out of the loop. No intended functionalty change. llvm-svn: 230845
* [llvm-pdbdump] Fix dumping of function pointers and basic types.Zachary Turner2015-02-261-25/+0
| | | | | | | | | | | | Function pointers were not correctly handled by the dumper, and they would print as "* name". They now print as "int (__cdecl *name)(int arg1, int arg2)" as they should. Also, doubles were being printed as floats. This fixes that bug as well, and adds tests for all builtin types. as well as a test for function pointers. llvm-svn: 230703
* [dwarfdump] Fix frame info register number dump.Frederic Riss2015-02-251-1/+1
| | | | llvm-svn: 230559
* Try to appease buildbots.Frederic Riss2015-02-251-1/+1
| | | | | | It seems ArrayRefs to multi-dimensional arrays confuse some compilers. llvm-svn: 230554
* [dwarfdump] Make debug_frame dump actually useful.Frederic Riss2015-02-251-3/+136
| | | | | | | | | | | | | | | | | | | | | | | | This adds support for pretty-printing instruction operands. The new output looks like: 00000000 00000010 ffffffff CIE Version: 1 Augmentation: Code alignment factor: 1 Data alignment factor: -4 Return address column: 8 DW_CFA_def_cfa: reg4 +4 DW_CFA_offset: reg8 -4 DW_CFA_nop: DW_CFA_nop: 00000014 00000010 00000000 FDE cie=00000000 pc=00000000...00000022 DW_CFA_advance_loc: 3 DW_CFA_def_cfa_offset: +12 DW_CFA_nop: llvm-svn: 230551
* [dwarfdump] Don't print meaningless pointer.Frederic Riss2015-02-251-3/+0
| | | | | | | CIE pointers were never filled in before, and printing the pointer is totally pointless anyway. llvm-svn: 230550
* DWARFDebugFrame: Move some code around. NFC.Frederic Riss2015-02-251-13/+10
| | | | | | | Move the FrameEntry::dumpInstructions down in the file at some place where it can see the declarations of FDE and CIE. llvm-svn: 230549
* DWARFDebugFrame: Add some trivial accessors. NFC.Frederic Riss2015-02-251-0/+5
| | | | | | To be used for dumping. llvm-svn: 230548
* DWARFDebugFrame: Actually collect CIEs associated with FDEs.Frederic Riss2015-02-251-6/+11
| | | | | | | | This is the first commit in a small series aiming at making debug_frame dump more useful (right now it prints a list of opeartions without their operands). llvm-svn: 230547
* Revert "Raising minimum required CMake version to 2.8.12.2."Tobias Grosser2015-02-241-1/+1
| | | | | | | | | | | This reverts commit r230062. Debian stable (wheezy) ships still with cmake 2.8.9. The commit broke my LLVM/Polly buildbot, to my knowledge our only Linux+cmake buildbot. llvm-svn: 230343
* Revert "Revert "Raising minimum required CMake version to 2.8.12.2.""Chad Rosier2015-02-231-1/+1
| | | | | | This reverts commit r230240, which was an accidental commit. llvm-svn: 230246
* Revert "Raising minimum required CMake version to 2.8.12.2."Chad Rosier2015-02-231-1/+1
| | | | | | This reverts commit 247aed4710e8befde76da42b27313661dea7cf66. llvm-svn: 230240
* [llvm-pdbdump] Very minor code cleanup.Zachary Turner2015-02-233-20/+15
| | | | | | | This just removes some dead enums as well as some debug flushes of stdout. llvm-svn: 230204
* [llvm-pdbdump] Add an option to dump full class definitions.Zachary Turner2015-02-235-4/+95
| | | | | | | | | | | This adds the --class-definitions flag. If specified, when dumping types, instead of "class Foo" you will see the full class definition, with member functions, constructors, access specifiers. NOTE: Using this option can be very slow, as generating a full class definition requires accessing many different parts of the PDB. llvm-svn: 230203
* [llvm-pdbdump] Rewrite dumper using visitor pattern.Zachary Turner2015-02-2235-498/+293
| | | | | | | | | | This increases the flexibility of how to dump different symbol types -- necessary for context-sensitive formatting of symbol types -- and also improves the modularity by allowing the dumping to be implemented in the actual dumper, as opposed to in the PDB library. llvm-svn: 230184
* [llvm-pdbdump] Simplify options and output.Zachary Turner2015-02-221-0/+1
| | | | | | | | | This removes a wealth of options, and instead now only provides three options. -symbols, -types, and -compilands. This greatly simplifies use of the tool, and makes it easier to understand what you're going to see when you run the tool. llvm-svn: 230182
* Raising minimum required CMake version to 2.8.12.2.Chris Bieneman2015-02-201-1/+1
| | | | llvm-svn: 230062
* llvm-pdbdump: Add flags controlling the type of values to dump.Zachary Turner2015-02-1532-226/+240
| | | | llvm-svn: 229330
* llvm-pdbdump: Only dump whitelisted global symbols.Zachary Turner2015-02-143-25/+37
| | | | | | | | | | Dumping the global scope contains a lot of very uninteresting things and is generally polluted with a lot of random junk. Furthermore, it dumps values unsorted, making it hard to read. This patch dumps known interesting types only, and as a side effect sorts the list by symbol type. llvm-svn: 229232
* llvm-pdbdump: Re-order header files according to LLVM style guide.Zachary Turner2015-02-1436-38/+109
| | | | llvm-svn: 229231
* Fix -Wunused-variable warning.Zachary Turner2015-02-131-1/+0
| | | | llvm-svn: 229130
* llvm-pdbdump: Improve printing of functions and signatures.Zachary Turner2015-02-134-38/+147
| | | | | | | | | This correctly prints the function pointers, and also prints function signatures for symbols as opposed to just types. So actual functions in your program will now be printed with full name and signature, as opposed to just name as before. llvm-svn: 229129
* Re-sort #include lines using my handy dandy ./utils/sort_includes.pyChandler Carruth2015-02-1338-81/+41
| | | | | | script. This is in preparation for changes to lots of include lines. llvm-svn: 229088
* llvm-pdbdump: Add more comprehensive dumping of symbol types.Zachary Turner2015-02-1319-108/+316
| | | | | | | | | In particular this patch adds the ability to dump complete function signature information including argument types as correctly formatted strings. A side effect of this is that almost all symbol and meta types are now formatted. llvm-svn: 229076
* Improve llvm-pdbdump output display.Zachary Turner2015-02-135-40/+250
| | | | | | | | | | | | This patch adds a number of improvements to llvm-pdbdump. 1) Dumping of the entire global scope, and not only those symbols that live in individual compilands. 2) Prepend class name to member functions and data 3) Improved display of bitfields. 4) Support for dumping more kinds of data symbols. llvm-svn: 229012
OpenPOWER on IntegriCloud