1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

37 Commits

Author SHA1 Message Date
Dehao Chen
9071034fad Add GNU_discriminator support for inline callsites in llvm-symbolizer.
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
2017-04-17 20:10:39 +00:00
David Blaikie
1eb956c2eb Get function start line number from DWARF info
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
2017-02-06 20:19:02 +00:00
David Blaikie
88723ee805 Make test case resilient to \ or / directory separators
llvm-svn: 293786
2017-02-01 17:34:41 +00:00
David Blaikie
f36f58b95b Add missing test cases from r293697/D29094
Differential Revision: https://reviews.llvm.org/D29368

llvm-svn: 293785
2017-02-01 17:15:24 +00:00
NAKAMURA Takumi
1de33b6dae Ignore llvm/test/tools/llvm-symbolizer/coff-exports.test on mingw.
FIXME: Demangler could behave along not host but target.
For example, assume host=mingw, target=msc.

llvm-svn: 293021
2017-01-25 05:26:23 +00:00
Kevin Enderby
5bbb04ae53 Fix a bugs with using some Mach-O command line flags like "-arch armv7m".
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
2016-12-16 22:54:02 +00:00
Chris Bieneman
a0cf841296 [LIT] Fix system-windows
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
2016-12-13 00:29:56 +00:00
Reid Kleckner
eb745c2e9c [Symbolize] Check if the PE file has a PDB and emit an error if we can't load it
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
2016-06-03 20:25:09 +00:00
Reid Kleckner
d8e7f2f768 [PDB] Fix function names for private symbols in PDBs
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
2016-04-27 16:10:29 +00:00
Tim Northover
5cc375dd3c MachO: remove weird ARM/Thumb interface from MachOObjectFile
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
2016-04-22 23:21:13 +00:00
Mandeep Singh Grang
28ddad394b [LLVM] Remove unwanted --check-prefix=CHECK from unit tests. NFC.
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
2016-04-19 23:51:52 +00:00
NAKAMURA Takumi
edec212b66 Make llvm/test/tools/llvm-symbolizer/pdb/pdb.test Py3-compatible.
llvm-svn: 260887
2016-02-15 13:19:13 +00:00
Mike Aizatsky
d03c218611 [llvm-symbolizer] -print-source-context-lines option to print source code around the line.
Differential Revision: http://reviews.llvm.org/D15909

llvm-svn: 257236
2016-01-09 00:14:35 +00:00
Mike Aizatsky
a5855c0f74 [llvm-symbolizer] Print out non-address lines verbatim.
Differential Revision: http://reviews.llvm.org/D15876

llvm-svn: 257115
2016-01-07 23:57:41 +00:00
Dimitry Andric
053841f2e3 Fix one file that I didn't convert properly in r256707.
llvm-svn: 256720
2016-01-03 22:33:32 +00:00
Dimitry Andric
0614f2a55e Fix several accidental DOS line endings in source files
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
2016-01-03 17:22:03 +00:00
Hemant Kulkarni
5477f5f0f0 [Symbolizer]: Add -pretty-print option
Differential Revision: http://reviews.llvm.org/D13671

llvm-svn: 252798
2015-11-11 20:41:43 +00:00
Colin LeMahieu
0b68751572 Reverting r252760
llvm-svn: 252770
2015-11-11 18:11:06 +00:00
Hemant Kulkarni
3b2ab0332b [Symbolizer]: Add -pretty-print option
Differential Revision: http://reviews.llvm.org/D13671

llvm-svn: 252760
2015-11-11 17:47:54 +00:00
Reid Kleckner
f9f47536b1 Disable a test relying on symbol demangling on non-Windows platforms
llvm-svn: 250587
2015-10-16 23:56:14 +00:00
Reid Kleckner
43d4930f19 [llvm-symbolizer] Use the export table if no symbols are present
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
2015-10-16 23:43:22 +00:00
Hemant Kulkarni
0464ae6dc8 [llvm-symbolizer] Add -print-address option
Differential Revision: http://reviews.llvm.org/D13518

llvm-svn: 250086
2015-10-12 19:26:44 +00:00
Colin LeMahieu
d73327a49c [llvm-symbolizer] Reverting r250067
llvm-svn: 250072
2015-10-12 17:57:02 +00:00
Hemant Kulkarni
7dd48fdc72 [llvm-symbolizer] Add -print-address option
Differential Revision  http://reviews.llvm.org/D13518

llvm-svn: 250067
2015-10-12 17:31:22 +00:00
Reid Kleckner
1d2b259b2b Fix pdb.test when python is not on PATH
llvm-svn: 249847
2015-10-09 16:49:56 +00:00
Reid Kleckner
ee25176b8c Fix coff-dwarf test for non-Windows platforms that cannot demangle MS C++ names
llvm-svn: 249795
2015-10-09 01:11:40 +00:00
Reid Kleckner
eab82a5f9e Address review comments, remove error case and return 0 instead as required by tests
llvm-svn: 249785
2015-10-09 00:15:08 +00:00
Reid Kleckner
758673811a [llvm-symbolizer] Make --relative-address work with DWARF contexts
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
2015-10-09 00:15:01 +00:00
Reid Kleckner
b6442713bb [llvm-symbolizer] Remove underscores and other C mangling on Windows
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
2015-08-10 21:47:11 +00:00
Frederic Riss
0c3b9888f7 [Object] Search for architecures by name in 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
2015-06-22 21:33:24 +00:00
Zachary Turner
193194d5e5 A few fixes for llvm-symbolizer on Windows.
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
2015-05-06 22:26:30 +00:00
Zachary Turner
3aea053fae Make llvm-symbolizer work on Windows.
Differential Revision: http://reviews.llvm.org/D9234
Reviewed By: Alexey Samsonov

llvm-svn: 235900
2015-04-27 17:19:51 +00:00
Manuel Klimek
b9e4e13a04 Was convinced in commit comments that requiring a specific python version is the wrong approach; reverting.
llvm-svn: 221679
2014-11-11 08:53:18 +00:00
Manuel Klimek
237675bcb3 Mark test using python as REQUIRES: python27.
llvm-svn: 221598
2014-11-10 15:29:29 +00:00
NAKAMURA Takumi
5fe96e2af7 llvm/test/tools/llvm-symbolizer/ppc64.test: Avoid subshell.
llvm-svn: 221526
2014-11-07 14:50:10 +00:00
Jay Foad
806a540487 llvm-symbolizer: teach it about PowerPC64 ELF function descriptors
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
2014-11-07 09:08:39 +00:00
Alexander Potapenko
f1146b8238 [llvm-symbolizer] Introduce the -dsym-hint option.
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
2014-10-17 00:50:19 +00:00