summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-symbolizer
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-symbolizer] SimplifyFangrui Song2018-05-261-1/+1
| | | | llvm-svn: 333334
* [llvm-symbolizer] Simplify. NFCFangrui Song2018-05-251-10/+5
| | | | llvm-svn: 333247
* Define InitLLVM to do common initialization all at once.Rui Ueyama2018-04-131-7/+2
| | | | | | | | | | | We have a few functions that virtually all command wants to run on process startup/shutdown. This patch adds InitLLVM class to do that all at once, so that we don't need to copy-n-paste boilerplate code to each llvm command's main() function. Differential Revision: https://reviews.llvm.org/D45602 llvm-svn: 330046
* Use itaniumDemangle in llvm-symbolizerEugene Zemtsov2018-03-071-0/+1
| | | | | | | | | Currently on Windows (_MSC_VER) LLVMSymbolizer supports only Microsoft mangling. This fix just explicitly uses itaniumDemangle when mangled name starts with _Z. Differential Revision: https://reviews.llvm.org/D44192 llvm-svn: 326959
* [tools] Add option to install binutils symlinksShoaib Meenai2017-11-021-0/+4
| | | | | | | | | | | | The LLVM tools can be used as a replacement for binutils, in which case it's convenient to create symlinks with the binutils names. Add support for these symlinks in the build system. As with any other llvm tool symlinks, the user can limit the installed symlinks by only adding the desired ones to `LLVM_TOOLCHAIN_TOOLS`. Differential Revision: https://reviews.llvm.org/D39530 llvm-svn: 317272
* DebugInfo: Provide option for explicitly specifying the name of the DWP fileDavid Blaikie2017-07-301-2/+8
| | | | | | | | | | | | | | | | If you've archived the DWP file somewhere it's probably useful to be able to just tell llvm-symbolizer where it is when you're symbolizing stack traces from the binary. This only provides a mechanism for specifying a single DWP file, good if you're symbolizing a program with a single DWP file, but it's likely if the program is dynamically linked that you might have a DWP for each dynamic library - in which case this feature won't help (at least as it's surfaced in llvm-symbolizer for now) - in theory it could be extended to specify a collection of DWP files that could all be consulted for split CU hash resolution. llvm-svn: 309498
* Add a verbose/human readable mode to llvm-symbolizer to investigate ↵David Blaikie2017-01-311-1/+4
| | | | | | | | | | discriminators and other line table/backtrace features Patch by Simon Que! Differential Revision: https://reviews.llvm.org/D29094 llvm-svn: 293697
* Turn cl::values() (for enum) from a vararg function to using C++ variadic ↵Mehdi Amini2016-10-081-2/+1
| | | | | | | | | | | | | | | template The core of the change is supposed to be NFC, however it also fixes what I believe was an undefined behavior when calling: va_start(ValueArgs, Desc); with Desc being a StringRef. Differential Revision: https://reviews.llvm.org/D25342 llvm-svn: 283671
* Search for llvm-symbolizer binary in the same directory as argv[0], beforeRichard Smith2016-06-091-1/+1
| | | | | | | looking for it along $PATH. This allows installs of LLVM tools outside of $PATH to find the symbolizer and produce pretty backtraces if they crash. llvm-svn: 272232
* [Symbolize] Check if the PE file has a PDB and emit an error if we can't load itReid Kleckner2016-06-031-6/+8
| | | | | | | | | | | | | | | | | | | | | Summary: Previously we would try to load PDBs for every PE executable we tried to symbolize. If that failed, we would fall back to DWARF. If there wasn't any DWARF, we'd print mostly useless symbol information using the export table. With this change, we only try to load PDBs for executables that claim to have them. If that fails, we can now print an error rather than falling back silently. This should make it a lot easier to diagnose and fix common symbolization issues, such as not having DIA or not having a PDB. Reviewers: zturner, eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D20982 llvm-svn: 271725
* Remove autoconf supportChris Bieneman2016-01-261-17/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened." - Obi Wan Kenobi Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16471 llvm-svn: 258861
* [llvm-symbolizer] -print-source-context-lines option to print source code ↵Mike Aizatsky2016-01-091-1/+5
| | | | | | | | around the line. Differential Revision: http://reviews.llvm.org/D15909 llvm-svn: 257236
* [llvm-symbolizer] Print out non-address lines verbatim.Mike Aizatsky2016-01-071-13/+21
| | | | | | Differential Revision: http://reviews.llvm.org/D15876 llvm-svn: 257115
* [Symbolizer]: Add -pretty-print optionHemant Kulkarni2015-11-111-2/+9
| | | | | | Differential Revision: http://reviews.llvm.org/D13671 llvm-svn: 252798
* Reverting r252760Colin LeMahieu2015-11-111-9/+2
| | | | llvm-svn: 252770
* [Symbolizer]: Add -pretty-print optionHemant Kulkarni2015-11-111-2/+9
| | | | | | Differential Revision: http://reviews.llvm.org/D13671 llvm-svn: 252760
* [LLVMSymbolize] Properly propagate object parsing errors from the library.Alexey Samsonov2015-11-041-3/+14
| | | | llvm-svn: 252021
* [LLVMSymbolize] Factor out the logic for printing structs from DIContext. NFC.Alexey Samsonov2015-11-031-6/+11
| | | | | | | | Introduce DIPrinter which takes care of rendering DILineInfo and friends. This allows LLVMSymbolizer class to return a structured data instead of plain std::strings. llvm-svn: 251989
* Let the users of LLVMSymbolizer decide whether they want to symbolize ↵Alexey Samsonov2015-10-301-3/+4
| | | | | | | | | | | inlined frames. Introduce LLVMSymbolizer::symbolizeInlinedCode() instead of switching on PrintInlining option passed to the constructor. This will be needed once we retrun structured data (instead of std::string) from LLVMSymbolizer and move printing logic out. llvm-svn: 251675
* Move parts of llvm-symbolizer tool into LLVMSymbolize library.Alexey Samsonov2015-10-265-798/+3
| | | | | | | | | | | | Summary: See http://lists.llvm.org/pipermail/llvm-dev/2015-October/091624.html Reviewers: echristo Subscribers: llvm-commits, aizatsky Differential Revision: http://reviews.llvm.org/D13998 llvm-svn: 251316
* Simplify boolean conditional return statements in tools/llvm-symbolizer.Rafael Espindola2015-10-241-3/+1
| | | | | | Patch by Richard. llvm-svn: 251216
* Speculative fix for GCC buildReid Kleckner2015-10-161-8/+11
| | | | llvm-svn: 250585
* [llvm-symbolizer] Use the export table if no symbols are presentReid Kleckner2015-10-162-0/+45
| | | | | | | | This lets us make guesses about symbols in third party DLLs without debug info, like MSVCR120.dll or kernel32.dll. dbghelp does the same thing. llvm-svn: 250582
* [llvm-symbolizer] Add -print-address optionHemant Kulkarni2015-10-121-0/+8
| | | | | | Differential Revision: http://reviews.llvm.org/D13518 llvm-svn: 250086
* [llvm-symbolizer] Reverting r250067Colin LeMahieu2015-10-121-8/+0
| | | | llvm-svn: 250072
* [llvm-symbolizer] Add -print-address optionHemant Kulkarni2015-10-121-0/+8
| | | | | | Differential Revision http://reviews.llvm.org/D13518 llvm-svn: 250067
* Address review comments, remove error case and return 0 instead as required ↵Reid Kleckner2015-10-091-2/+1
| | | | | | by tests llvm-svn: 249785
* [llvm-symbolizer] Make --relative-address work with DWARF contextsReid Kleckner2015-10-092-2/+22
| | | | | | | | | | | | | | | | Summary: Previously the relative address flag only affected PDB debug info. Now both DIContext implementations always expect to be passed virtual addresses. llvm-symbolizer is now responsible for adding ImageBase to module offsets when --relative-offset is passed. Reviewers: zturner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12883 llvm-svn: 249784
* [llvm-symbolizer] Remove underscores and other C mangling on WindowsReid Kleckner2015-08-102-29/+81
| | | | | | | | | | | | | | | Summary: This makes it so that reports symbolized after the fact with llvm-symbolizer are more similar to the ones we generate at runtime with in-process dbghelp. Reviewers: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11785 llvm-svn: 244512
* Delete UnknownAddress. It is a perfectly valid symbol value.Rafael Espindola2015-07-071-2/+0
| | | | | | | | | | | getSymbolValue now returns a value that in convenient for most callers: * 0 for undefined * symbol size for common symbols * offset/address for symbols the rest Code that needs something more specific can check getSymbolFlags. llvm-svn: 241605
* Return ErrorOr from getSymbolAddress.Rafael Espindola2015-07-031-3/+5
| | | | | | | It can fail trying to get the section on ELF and COFF. This makes sure the error is handled. llvm-svn: 241366
* Return ErrorOr from SymbolRef::getName.Rafael Espindola2015-07-021-2/+3
| | | | | | | | | | | | This function can really fail since the string table offset can be out of bounds. Using ErrorOr makes sure the error is checked. Hopefully a lot of the boilerplate code in tools/* can go away once we have a diagnostic manager in Object. llvm-svn: 241297
* [Support] Lazy load of dbghlp.dll on WindowsLeny Kholodov2015-07-021-0/+1
| | | | | | | | | | | | | This patch changes linkage with dbghlp.dll for clang from static (at load time) to on demand (at the first use of required functions). Clang uses dbghlp.dll only in minor use-cases. First of all in case of crash and in case of plugin load. The dbghlp.dll library can be absent on system. In this case clang will fail to load. With lazy load of dbghlp.dll clang can work even if dbghlp.dll is not available. Differential Revision: http://reviews.llvm.org/D10737 llvm-svn: 241271
* Simplify getSymbolType.Rafael Espindola2015-06-261-3/+1
| | | | | | | | This is still a really odd function. Most calls are in object format specific contexts and should probably be replaced with a more direct query, but at least now this is not too obnoxious to use. llvm-svn: 240777
* Use computeSymbolSizes in llvm-symbolize.Rafael Espindola2015-06-252-21/+8
| | | | llvm-svn: 240646
* Modernize getELFDynamicSymbolIterators.Rafael Espindola2015-06-251-4/+3
| | | | | | | | * Have it return a iterator_range. * Remove the global function. * Rename to getDynamicSymbolIterators. llvm-svn: 240644
* Change how symbol sizes are handled in lib/Object.Rafael Espindola2015-06-241-9/+6
| | | | | | | | | | | | | | COFF and MachO only define symbol sizes for common symbols. Reflect that in the class hierarchy by having a method for common symbols only in the base and a general one in ELF. This avoids the need of using a magic value for the size, which had a few problems * Most callers didn't check for it. * The ones that did could not tell the magic value from a file actually having that value. llvm-svn: 240529
* [Object] Search for architecures by name in ↵Frederic Riss2015-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | MachOUniversalBinary::getObjectForArch() The reason we need to search by name rather than by Triple::ArchType is to handle subarchitecture correclty. There is no different ArchType for the x86_64h architecture (it identifies itself as x86_64), or for the various ARM subarches. The only way to get to the subarch slice in an universal binary is to search by name. This issue led to hard to debug and transient symbolication failures in Asan tests (it mostly works, because the files are very similar). This also affects the Profiling infrastucture as it is the other user of that API. Reviewers: samsonov, bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10604 llvm-svn: 240339
* Simplify another function that doesn't fail.Rafael Espindola2015-06-011-3/+5
| | | | llvm-svn: 238703
* A few fixes for llvm-symbolizer on Windows.Zachary Turner2015-05-063-14/+38
| | | | | | | | | 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
* [llvm-symbolizer] Link DebugInfoPDB for the autoconf buildZachary Turner2015-04-271-1/+1
| | | | llvm-svn: 235909
* Make llvm-symbolizer work on Windows.Zachary Turner2015-04-273-1/+20
| | | | | | | Differential Revision: http://reviews.llvm.org/D9234 Reviewed By: Alexey Samsonov llvm-svn: 235900
* Move DIContext.h to common DebugInfo location.Zachary Turner2015-04-232-2/+3
| | | | | | | | | | 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
* Purge unused includes throughout libSupport.Benjamin Kramer2015-03-231-0/+1
| | | | | | NFC. llvm-svn: 232976
* Move DebugInfo to DebugInfo/DWARF.Zachary Turner2015-01-303-3/+3
| | | | | | | | | | | | | 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
* llvm-symbolizer: teach it about PowerPC64 ELF function descriptorsJay Foad2014-11-072-4/+40
| | | | | | | | | | | | | | | | | Summary: Teach llvm-symbolizer about PowerPC64 ELF function descriptors. Symbols in the .opd section point to function descriptors, the first word of which is a pointer to the real function. For the purposes of symbolizing we pretend that the symbol points directly to the function. This is enough to get decent function names in stack traces for unoptimized binaries, which fixes the sanitizer print-stack-trace test on PowerPC64 Linux. Reviewers: kcc, willschm, samsonov Reviewed By: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6110 llvm-svn: 221514
* [Object] Modify OwningBinary's interface to separate inspection from ownership.Lang Hames2014-10-312-6/+9
| | | | | | | | The getBinary and getBuffer method now return ordinary pointers of appropriate const-ness. Ownership is transferred by calling takeBinary(), which returns a pair of the Binary and a MemoryBuffer. llvm-svn: 221003
* [llvm-symbolizer] Introduce the -dsym-hint option.Alexander Potapenko2014-10-173-50/+108
| | | | | | | llvm-symbolizer will consult one of the .dSYM paths passed via -dsym-hint if it fails to find the .dSYM bundle at the default location. llvm-svn: 220004
* [llvm-symbolizer] Minor typedef cleanup. NFC.Alexander Potapenko2014-10-142-23/+20
| | | | llvm-svn: 219682
* Follow-up for r217020: actually commit the fix for PR20800,Alexander Potapenko2014-09-031-11/+1
| | | | | | revert the accidentally committed changes to LLVMSymbolize.cpp llvm-svn: 217021
OpenPOWER on IntegriCloud