summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-symbolizer
Commit message (Collapse)AuthorAgeFilesLines
...
* [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.Shiva Chen2018-05-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to set breakpoints on labels and list source code around labels, we need collect debug information for labels, i.e., label name, the function label belong, line number in the file, and the address label located. In order to keep these information in LLVM IR and to allow backend to generate debug information correctly. We create a new kind of metadata for labels, DILabel. The format of DILabel is !DILabel(scope: !1, name: "foo", file: !2, line: 3) We hope to keep debug information as much as possible even the code is optimized. So, we create a new kind of intrinsic for label metadata to avoid the metadata is eliminated with basic block. The intrinsic will keep existing if we keep it from optimized out. The format of the intrinsic is llvm.dbg.label(metadata !1) It has only one argument, that is the DILabel metadata. The intrinsic will follow the label immediately. Backend could get the label metadata through the intrinsic's parameter. We also create DIBuilder API for labels to be used by Frontend. Frontend could use createLabel() to allocate DILabel objects, and use insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR. Differential Revision: https://reviews.llvm.org/D45024 Patch by Hsiangkai Wang. llvm-svn: 331841
* Fix computeSymbolSizes SEGFAULT on invalid fileAdrian Prantl2018-04-231-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | We use llvm-symbolizer in some production systems, and we run it against all possibly related files, including some that are not ELF. We noticed that for some of those invalid files, llvm-symbolizer would crash with SEGFAULT. Here is an example of such a file. It is due to that in computeSymbolSizes, a loop uses condition for (unsigned I = 0, N = Addresses.size() - 1; I < N; ++I) { where if Addresses.size() is 0, N would overflow and causing the loop to access invalid memory. Instead of patching the loop conditions, the commit makes so that the function returns early if Addresses is empty. Validated by checking that llvm-symbolizer no longer crashes. Patch by Teng Qin! Differential Revision: https://reviews.llvm.org/D44285 llvm-svn: 330610
* [llvm-symbolizer] Use correct path when resolving .gnu_debuglink in .debugFrancis Ricci2018-03-021-0/+26
| | | | | | | | | | | | | | | Summary: The symbolizer was checking for .debug as a subdirectory of the binary file itself, not of the directory containing the binary. This led to a failure to find split debug info when it was contained in a .debug directory. Reviewers: rnk, glider, zturner Subscribers: llvm-commits, aprantl Differential Revision: https://reviews.llvm.org/D44025 llvm-svn: 326630
* [lit] Fix a problem with spaces in the python path by adding quotes around itAaron Smith2018-02-212-2/+2
| | | | | | These are the last tests left to fix after D43265. llvm-svn: 325657
* [llvm-symbolizer] Fix coff-dwarf.testZachary Turner2017-09-161-1/+1
| | | | | | | | | | | | | | | | | | This was a bug in the test that was only exposed as a result of refactoring some code in lit configuration files. Previously, llvm's lit configuration would only set the target-windows feature if the system was also windows. Since cross-compilation is a thing, this isn't correct. target-windows should be set independently of system-windows. Adding to that bug, this particular test then checked for target-windows when it really meant "can I call a certain API on the host machine", which is what system-windows is for. Ultimately, this test only works if *both* the target and host are Windows, so I've updated the test to reflect that. llvm-svn: 313468
* Get rid of even more "%T" expansions, see <https://reviews.llvm.org/D35396>.Kuba Mracek2017-08-201-4/+5
| | | | llvm-svn: 311294
* llvm-symbolizer/print_context.c test: Make debug info path independentDavid Blaikie2017-07-302-1/+6
| | | | llvm-svn: 309518
* llvm-symbolizer: Make test portable using an explicit object file rather ↵David Blaikie2017-07-302-12/+11
| | | | | | than the host compiler llvm-svn: 309517
* Make test robust to changes in prefix/avoid hardcoded line numbersDavid Blaikie2017-07-301-7/+8
| | | | llvm-svn: 309516
* Revert "[AVR] Mark a failing symbolizer test as XFAIL"Dylan McKay2017-07-301-3/+0
| | | | | | This reverts commit 83a0e876349adb646ba858eb177b22b0b4bfc59a. llvm-svn: 309515
* [AVR] Mark a failing symbolizer test as XFAILDylan McKay2017-07-301-0/+3
| | | | llvm-svn: 309512
* Using address range map to speedup finding inline stack for address.Dehao Chen2017-04-191-0/+40
| | | | | | | | | | | | | | | | | | | | Summary: In the current implementation, to find inline stack for an address incurs expensive linear search in 2 places: * linear search for the top-level DIE * recursive linear traverse the DIE tree to find the path to the leaf DIE In this patch, a map is built from address to its corresponding leaf DIE. The inline stack is built by traversing from the leaf DIE up to the root DIE. This speeds up batch symbolization by ~10X without noticible memory overhead. Reviewers: dblaikie Reviewed By: dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32177 llvm-svn: 300742
* Update the test to fix the buildbot failure introduced by r300486 (NFC)Dehao Chen2017-04-171-12/+12
| | | | llvm-svn: 300492
* Add GNU_discriminator support for inline callsites in llvm-symbolizer.Dehao Chen2017-04-174-28/+92
| | | | | | | | | | | | | | Summary: LLVM symbolize cannot recognize GNU_discriminator for inline callsites. This patch adds support for it. Reviewers: dblaikie Reviewed By: dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32134 llvm-svn: 300486
* Get function start line number from DWARF infoDavid Blaikie2017-02-061-0/+3
| | | | | | | | | | | | | | | DWARF info contains info about the line number at which a function starts (DW_AT_decl_line). This patch creates a function to look up the start line number for a function, and returns it in DILineInfo when looking up debug info for a particular address. Patch by Simon Que! Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D27962 llvm-svn: 294231
* Make test case resilient to \ or / directory separatorsDavid Blaikie2017-02-011-3/+3
| | | | llvm-svn: 293786
* Add missing test cases from r293697/D29094David Blaikie2017-02-014-0/+49
| | | | | | Differential Revision: https://reviews.llvm.org/D29368 llvm-svn: 293785
* Ignore llvm/test/tools/llvm-symbolizer/coff-exports.test on mingw.NAKAMURA Takumi2017-01-251-1/+3
| | | | | | | FIXME: Demangler could behave along not host but target. For example, assume host=mingw, target=msc. llvm-svn: 293021
* Fix a bugs with using some Mach-O command line flags like "-arch armv7m".Kevin Enderby2016-12-161-2/+2
| | | | | | | | | | | | | | | | | | The Mach-O command line flag like "-arch armv7m" does not match the arch name part of its llvm Triple which is "thumbv7m-apple-darwin”. I think the best way to fix this is to have llvm::object::MachOObjectFile::getArchTriple() optionally return the name of the Mach-O arch flag that would be used with -arch that matches the CPUType and CPUSubType. Then change llvm::object::MachOUniversalBinary::ObjectForArch::getArchTypeName() to use that and change it to getArchFlagName() as the type name is really part of the Triple and the -arch flag name is a Mach-O thing for a specific Triple with a specific Mcpu value. rdar://29663637 llvm-svn: 290001
* [LIT] Fix system-windowsChris Bieneman2016-12-131-1/+1
| | | | | | | | Turns out if you were on windows and your default target wasn't windows the system-windows feature wasn't getting enabled. This fixes that and updates the coff-dwarf test to rely on the new "target-windows" feature. That test was the reason why system-windows was changed to not always be enabled on Windows hosts. llvm-svn: 289503
* [Symbolize] Check if the PE file has a PDB and emit an error if we can't load itReid Kleckner2016-06-032-0/+17
| | | | | | | | | | | | | | | | | | | | | 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
* [PDB] Fix function names for private symbols in PDBsReid Kleckner2016-04-274-14/+22
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: llvm-symbolizer wants to get linkage names of functions for historical reasons. Linkage names are only recorded in the PDB for public symbols, and the linkage name is apparently stored separately in some "public symbol" record. We had a workaround in PDBContext which would look for such symbols when the user requested linkage names. However, when given an address that was truly in a private function and public funciton, we would accidentally find nearby public symbols and return those function names. The fix is to look for both function symbols and public symbols and only prefer the public symbol name if the addresses of the symbols agree. Fixes PR27492 Reviewers: zturner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19571 llvm-svn: 267732
* MachO: remove weird ARM/Thumb interface from MachOObjectFileTim Northover2016-04-221-2/+2
| | | | | | | | | | | | | | | | Only one consumer (llvm-objdump) actually cared about the fact that there were two triples. Others were actively working around the fact that the Triple returned by getArch might have been invalid. As for llvm-objdump, it needs to be acutely aware of both Triples anyway, so being generic in the exposed API is no benefit. Also rename the version of getArch returning a Triple. Users were having to pass an unwanted nullptr to disambiguate the two, which was nasty. The only functional change here is that armv7m and armv7em object files no longer crash llvm-objdump. llvm-svn: 267249
* [LLVM] Remove unwanted --check-prefix=CHECK from unit tests. NFC.Mandeep Singh Grang2016-04-192-2/+2
| | | | | | | | | | | | Summary: Removed unwanted --check-prefix=CHECK from numerous unit tests. Reviewers: t.p.northover, dblaikie, uweigand, MatzeB, tstellarAMD, mcrosier Subscribers: mcrosier, dsanders Differential Revision: http://reviews.llvm.org/D19279 llvm-svn: 266834
* Make llvm/test/tools/llvm-symbolizer/pdb/pdb.test Py3-compatible.NAKAMURA Takumi2016-02-151-1/+1
| | | | llvm-svn: 260887
* [llvm-symbolizer] -print-source-context-lines option to print source code ↵Mike Aizatsky2016-01-091-0/+22
| | | | | | | | around the line. Differential Revision: http://reviews.llvm.org/D15909 llvm-svn: 257236
* [llvm-symbolizer] Print out non-address lines verbatim.Mike Aizatsky2016-01-072-0/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D15876 llvm-svn: 257115
* Fix one file that I didn't convert properly in r256707.Dimitry Andric2016-01-031-1/+1
| | | | llvm-svn: 256720
* Fix several accidental DOS line endings in source filesDimitry Andric2016-01-031-1/+1
| | | | | | | | | | | | | | | Summary: There are a number of files in the tree which have been accidentally checked in with DOS line endings. Convert these to native line endings. There are also a few files which have DOS line endings on purpose, and I have set the svn:eol-style property to 'CRLF' on those. Reviewers: joerg, aaron.ballman Subscribers: aaron.ballman, sanjoy, dsanders, llvm-commits Differential Revision: http://reviews.llvm.org/D15848 llvm-svn: 256707
* [Symbolizer]: Add -pretty-print optionHemant Kulkarni2015-11-112-3/+14
| | | | | | Differential Revision: http://reviews.llvm.org/D13671 llvm-svn: 252798
* Reverting r252760Colin LeMahieu2015-11-112-14/+3
| | | | llvm-svn: 252770
* [Symbolizer]: Add -pretty-print optionHemant Kulkarni2015-11-112-3/+14
| | | | | | Differential Revision: http://reviews.llvm.org/D13671 llvm-svn: 252760
* Disable a test relying on symbol demangling on non-Windows platformsReid Kleckner2015-10-161-0/+3
| | | | llvm-svn: 250587
* [llvm-symbolizer] Use the export table if no symbols are presentReid Kleckner2015-10-164-1/+38
| | | | | | | | 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-123-0/+20
| | | | | | Differential Revision: http://reviews.llvm.org/D13518 llvm-svn: 250086
* [llvm-symbolizer] Reverting r250067Colin LeMahieu2015-10-122-20/+0
| | | | llvm-svn: 250072
* [llvm-symbolizer] Add -print-address optionHemant Kulkarni2015-10-122-0/+20
| | | | | | Differential Revision http://reviews.llvm.org/D13518 llvm-svn: 250067
* Fix pdb.test when python is not on PATHReid Kleckner2015-10-091-1/+1
| | | | llvm-svn: 249847
* Fix coff-dwarf test for non-Windows platforms that cannot demangle MS C++ namesReid Kleckner2015-10-091-0/+3
| | | | llvm-svn: 249795
* Address review comments, remove error case and return 0 instead as required ↵Reid Kleckner2015-10-094-20/+23
| | | | | | by tests llvm-svn: 249785
* [llvm-symbolizer] Make --relative-address work with DWARF contextsReid Kleckner2015-10-095-0/+40
| | | | | | | | | | | | | | | | 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-105-18/+37
| | | | | | | | | | | | | | | 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
* [Object] Search for architecures by name in ↵Frederic Riss2015-06-223-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | 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
* A few fixes for llvm-symbolizer on Windows.Zachary Turner2015-05-066-15/+36
| | | | | | | | | 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
* Make llvm-symbolizer work on Windows.Zachary Turner2015-04-276-0/+20
| | | | | | | Differential Revision: http://reviews.llvm.org/D9234 Reviewed By: Alexey Samsonov llvm-svn: 235900
* Was convinced in commit comments that requiring a specific python version is ↵Manuel Klimek2014-11-111-1/+0
| | | | | | the wrong approach; reverting. llvm-svn: 221679
* Mark test using python as REQUIRES: python27.Manuel Klimek2014-11-101-0/+1
| | | | llvm-svn: 221598
* llvm/test/tools/llvm-symbolizer/ppc64.test: Avoid subshell.NAKAMURA Takumi2014-11-071-1/+1
| | | | llvm-svn: 221526
* llvm-symbolizer: teach it about PowerPC64 ELF function descriptorsJay Foad2014-11-072-0/+11
| | | | | | | | | | | | | | | | | 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
* [llvm-symbolizer] Introduce the -dsym-hint option.Alexander Potapenko2014-10-178-0/+62
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
OpenPOWER on IntegriCloud