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

1667 Commits

Author SHA1 Message Date
Michael Pozulp
43b3bb454d Revert "[llvm-objdump] Re-commit r367284."
This reverts r367776 (git commit d34099926e909390cb0254bebb4b7f5cf15467c7).
My changes to llvm-objdump tests caused them to fail on windows:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/27368

llvm-svn: 367816
2019-08-05 08:52:28 +00:00
Fangrui Song
16a86d6b17 [DWARF] Change DWARFDebugLoc::Entry::Loc from SmallVector<char, 4> to SmallString<4>
SmallString has a conversion to StringRef, which can be leveraged to
simplify two use sites.

llvm-svn: 367801
2019-08-05 06:33:52 +00:00
Michael Pozulp
61b00e28c7 [llvm-objdump] Re-commit r367284.
Add warning messages if disassembly + source for problematic inputs

Summary: Addresses https://bugs.llvm.org/show_bug.cgi?id=41905

Reviewers: jhenderson, rupprecht, grimar

Reviewed By: jhenderson, grimar

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62462

llvm-svn: 367776
2019-08-04 06:04:00 +00:00
JF Bastien
fada9e9b93 Remove support for unsupported MSVC versions
Re-land r367727 with the #if fixed.

Reviewers: rnk, lebedev.ri

Subscribers: hiraditya, jkorous, dexonsmith, lebedev.ri, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65662

llvm-svn: 367734
2019-08-02 23:09:01 +00:00
JF Bastien
507c70c558 Revert "Remove support for unsupported MSVC versions"
Mismatched preprocessor, I'll fix in a follow-up.

llvm-svn: 367728
2019-08-02 22:02:25 +00:00
JF Bastien
92e42b0a20 Remove support for unsupported MSVC versions
Reviewers: rnk, lebedev.ri

Subscribers: hiraditya, jkorous, dexonsmith, lebedev.ri, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65662

llvm-svn: 367727
2019-08-02 21:52:35 +00:00
Eric Christopher
3ca8e94f65 Temporarily Revert "Changing representation of cv_def_range directives in Codeview debug info assembly format for better readability"
This is breaking bots and the author asked me to revert.

This reverts commit 367704.

llvm-svn: 367707
2019-08-02 19:10:37 +00:00
Nilanjana Basu
4126a8f15d Changing representation of cv_def_range directives in Codeview debug info assembly format for better readability
llvm-svn: 367704
2019-08-02 18:44:39 +00:00
Eric Christopher
6a885f738e Temporarily revert "Changes to improve CodeView debug info type record inline comments"
due to a sanitizer failure.

This reverts commit 367623.

llvm-svn: 367640
2019-08-02 01:05:47 +00:00
Nilanjana Basu
aaeb3919d3 Changes to improve CodeView debug info type record inline comments
Signed-off-by: Nilanjana Basu <nilanjana.basu87@gmail.com>
llvm-svn: 367623
2019-08-01 22:05:14 +00:00
Djordje Todorovic
30604a8ec2 Reland "[DwarfDebug] Dump call site debug info"
The build failure found after the rL365467 has been
resolved.

Differential Revision: https://reviews.llvm.org/D60716

llvm-svn: 367446
2019-07-31 16:51:28 +00:00
Michael Pozulp
968cd8a990 Revert "[llvm-objdump] Add warning messages if disassembly + source for problematic inputs"
This reverts r367284 (git commit b1cbe51bdf44098c74f5c74b7bcd8c041a7c6772).
My changes to LLVMSymbolizer caused a test to fail:
http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/29488

llvm-svn: 367286
2019-07-30 07:05:27 +00:00
Michael Pozulp
101430b660 [llvm-objdump] Add warning messages if disassembly + source for problematic inputs
Summary: Addresses https://bugs.llvm.org/show_bug.cgi?id=41905

Reviewers: jhenderson, rupprecht, grimar

Reviewed By: jhenderson, grimar

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62462

llvm-svn: 367284
2019-07-30 05:28:26 +00:00
Igor Kudrin
1b01df0e0a [DWARF][NFC] Add constants for reserved values of an initial length field.
Differential Revision: https://reviews.llvm.org/D65039

llvm-svn: 366887
2019-07-24 11:34:29 +00:00
Jonas Devlieghere
1746dd941b [DWARF] Use 32-bit format specifier for offset
This should fix PR42730.

llvm-svn: 366859
2019-07-23 22:34:21 +00:00
Jonas Devlieghere
d32db46951 [DWARF] Add more error handling to debug line parser.
This patch exnteds the error handling in the debug line parser to get
rid of the existing MD5 assertion. I want to reuse the debug line parser
from LLVM in LLDB where we cannot crash on invalid input.

Differential revision: https://reviews.llvm.org/D64544

llvm-svn: 366762
2019-07-22 23:23:34 +00:00
Nilanjana Basu
fd1c0c5b07 Changes to emit CodeView debug info nested type records properly using MCStreamer directives
llvm-svn: 366720
2019-07-22 18:22:55 +00:00
Hsiangkai Wang
fc3df54f27 [DebugInfo] Generate fixups as emitting DWARF .debug_frame/.eh_frame.
It is necessary to generate fixups in .debug_frame or .eh_frame as
relaxation is enabled due to the address delta may be changed after
relaxation.

There is an opcode with 6-bits data in debug frame encoding. So, we
also need 6-bits fixup types.

Differential Revision: https://reviews.llvm.org/D58335

llvm-svn: 366524
2019-07-19 02:03:34 +00:00
Hsiangkai Wang
8690bbfb57 Revert "[DebugInfo] Generate fixups as emitting DWARF .debug_frame/.eh_frame."
This reverts commit 17e3cbf5fe656483d9016d0ba9e1d0cd8629379e.

llvm-svn: 366444
2019-07-18 15:06:50 +00:00
Hsiangkai Wang
945bcd9b26 [DebugInfo] Generate fixups as emitting DWARF .debug_frame/.eh_frame.
It is necessary to generate fixups in .debug_frame or .eh_frame as
relaxation is enabled due to the address delta may be changed after
relaxation.

There is an opcode with 6-bits data in debug frame encoding. So, we
also need 6-bits fixup types.

Differential Revision: https://reviews.llvm.org/D58335

llvm-svn: 366442
2019-07-18 14:47:34 +00:00
Alex Bradbury
a97047278a [DWARF][RISCV] Add support for RISC-V relocations needed for debug info
When code relaxation is enabled many RISC-V fixups are not resolved but
instead relocations are emitted. This happens even for DWARF debug
sections. Therefore, to properly support the parsing of DWARF debug info
we need to be able to resolve RISC-V relocations. This patch adds:

* Support for RISC-V relocations in RelocationResolver
* DWARF support for two relocations per object file offset
* DWARF changes to support relocations in more DIE fields

The two relocations per offset change is needed because some RISC-V
relocations (used for label differences) come in pairs.

Relocations can also be emitted for DWARF fields where relocations were
not yet evaluated. Adding relocation support for some of these fields is
essencial. On the other hand, LLVM currently emits RISC-V relocations
for fixups that could be safely evaluated, since they can never be
affected by code relaxations. This patch also adds relocation support
for the fields affected by those extraneous relocations (the DWARF unit
entry Length, and the DWARF debug line entry TotalLength and
PrologueLength), for testing purposes.

Differential Revision: https://reviews.llvm.org/D62062
Patch by Luís Marques.

llvm-svn: 366402
2019-07-18 05:22:55 +00:00
Nilanjana Basu
9afc97063e Changes to display code view debug info type records in hex format
llvm-svn: 366390
2019-07-17 23:43:58 +00:00
Nico Weber
28b4519628 llvm-pdbdump: Fix several smaller issues with injected source compression handling
- getCompression() used to return a PDB_SourceCompression even though
  the docs for IDiaInjectedSource are explicit about the return value
  being compiler-dependent. Return an uint32_t instead, and make the
  printing code handle unknown values better by printing "Unknown" and
  the int value instead of not printing any compression.

- Print compressed contents as hex dump, not as string.

- Add compression type "DotNet", which is used (at least) by csc.exe,
  the C# compiler. Also add a lengthy comment describing the stream
  contents (derived from looking at the raw hex contents long enough
  to see the GUIDs, which led me to the roslyn and mono implementations
  for handling this).

- The native injected source dumper was dumping the contents of the
  whole data stream -- but csc.exe writes a stream that's padded with
  zero bytes to the next 512 boundary, and the dia api doesn't display
  those padding bytes. So make NativeInjectedSource::getCode() do the
  same thing.

Differential Revision: https://reviews.llvm.org/D64879

llvm-svn: 366386
2019-07-17 22:59:52 +00:00
Nilanjana Basu
dc4f1b8ff0 Adding inline comments to code view type record directives for better readability
llvm-svn: 366372
2019-07-17 21:01:12 +00:00
Nico Weber
976fc4cd8f Teach llvm-pdbutil pretty -native about -injected-sources
`pretty -native -injected-sources -injected-source-content` works with
this patch, and produces identical output to the dia version.

Differential Revision: https://reviews.llvm.org/D64428

llvm-svn: 366236
2019-07-16 18:04:26 +00:00
Igor Kudrin
c707e71aa1 [DWARF] Fix the reserved values for unit length in DWARFDebugLine.
The DWARF3 documentation had inconsistency concerning the reserved range
for unit length values. The issue was fixed in DWARF4.

Differential Revision: https://reviews.llvm.org/D64622

llvm-svn: 366190
2019-07-16 07:01:08 +00:00
Igor Kudrin
0b76a06c69 [DWARF] Fix an incorrect format specifier.
This adjusts the format specifier because PCOffset is uint16_t.

Differential Revision: https://reviews.llvm.org/D64620

llvm-svn: 366189
2019-07-16 06:56:10 +00:00
Igor Kudrin
3e859df823 [DWARF] Simplify DWARFAttribute. NFC.
The first argument in the constructor was ignored, and the remaining
arguments were always passed as their defaults.

Differential Revision: https://reviews.llvm.org/D64407

llvm-svn: 366188
2019-07-16 06:53:06 +00:00
Jonas Devlieghere
e91ea804fa Re-land "[DebugInfo] Move function from line table to the prologue (NFC)"
In LLDB, when parsing type units, we don't need to parse the whole line
table. Instead, we only need to parse the "support files" from the line
table prologue.

To make that possible, this patch moves the respective functions from
the LineTable into the Prologue. Because I don't think users of the
LineTable should have to know that these files come from the Prologue,

I've left the original methods in place, and made them redirect to the
LineTable.

Differential revision: https://reviews.llvm.org/D64774

llvm-svn: 366164
2019-07-16 01:21:25 +00:00
Jonas Devlieghere
3d2f6011b6 Revert "[DebugInfo] Move function from line table to the prologue (NFC)"
This broke LLD, which I didn't have enabled.

llvm-svn: 366160
2019-07-16 00:59:04 +00:00
Jonas Devlieghere
fe3b4f3f08 [DebugInfo] Move function from line table to the prologue (NFC)
In LLDB, when parsing type units, we don't need to parse the whole line
table. Instead, we only need to parse the "support files" from the line
table prologue.

To make that possible, this patch moves the respective functions from
the LineTable into the Prologue. Because I don't think users of the
LineTable should have to know that these files come from the Prologue,

I've left the original methods in place, and made them redirect to the
LineTable.

Differential revision: https://reviews.llvm.org/D64774

llvm-svn: 366158
2019-07-16 00:37:17 +00:00
Nico Weber
060818b25b Expand comment about how StringsToBuckets was computed, and add more entries
The construction was explained in
https://reviews.llvm.org/D44810?id=139526#inline-391999 but reading the code
shouldn't require hunting down old reviews to understand it.

The precomputed list was missing an entry for the empty list case, and
one entry at the very end. (The current last entry is the last one where
3 * BucketCount fits in a signed int, but the reference implementation
uses unsigneds as far as I can tell, so there's room for one more entry.)

No behavior change for inputs seen in practice.

Differential Revision: https://reviews.llvm.org/D64738

llvm-svn: 366107
2019-07-15 18:56:56 +00:00
Nico Weber
70b8986c96 PDB HashTable: Move TraitsT from class parameter to the methods that need it
The traits object is only used by a few methods. Deserializing a hash
table and walking it is possible without the traits object, so it
shouldn't be required to build a dummy object for that use case.

The TraitsT object used to be a function template parameter before
r327647, this restores it to that state.

This makes it clear that the traits object isn't needed at all in 1 of
the current 3 uses of HashTable (and I am going to add another use that
doesn't need it), and that the default PdbHashTraits isn't used outside
of tests.

While here, also re-enable 3 checks in the test that were commented out
(which requires making HashTableInternals templated and giving FooBar
an operator==).

No intended behavior change.

Differential Revision: https://reviews.llvm.org/D64640

llvm-svn: 365974
2019-07-12 23:30:55 +00:00
Nico Weber
fb12a4dfa5 Slightly simplify MappedBlockStream::createIndexedStream() calls
All callers had a PDBFile object at hand, so call
Pdb.createIndexedStream() instead, which pre-populates all the arguments
(and returns nullptr for kInvalidStreamIndex).

Also change safelyCreateIndexedStream() to only take the string index,
and update callers. Make the method public and call it in two places
that manually did the bounds checking before.

No intended behavior change.

Differential Revision: https://reviews.llvm.org/D64633

llvm-svn: 365936
2019-07-12 18:24:38 +00:00
Djordje Todorovic
4cf81cc46f Revert "[DwarfDebug] Dump call site debug info"
A build failure was found on the SystemZ platform.

This reverts commit 9e7e73578e54cd22b3c7af4b54274d743b6607cc.

llvm-svn: 365886
2019-07-12 09:45:12 +00:00
Nico Weber
6e0926614f Fix a few 'no newline at end of file' warnings that Xcode emits
(Xcode even has a snazzy "Fix" button, but clicking that inserts two
newlines. So close!)

llvm-svn: 365789
2019-07-11 15:26:45 +00:00
Djordje Todorovic
0eecf47aa8 [DwarfDebug] Dump call site debug info
Dump the DWARF information about call sites and call site parameters into
debug info sections.

The patch also provides an interface for the interpretation of instructions
that could load values of a call site parameters in order to generate DWARF
about the call site parameters.

([13/13] Introduce the debug entry values.)

Co-authored-by: Ananth Sowda <asowda@cisco.com>
Co-authored-by: Nikola Prica <nikola.prica@rt-rk.com>
Co-authored-by: Ivan Baev <ibaev@cisco.com>

Differential Revision: https://reviews.llvm.org/D60716

llvm-svn: 365467
2019-07-09 11:33:56 +00:00
Nilanjana Basu
d74c95fbac Changing CodeView debug info type record representation in assembly files to make it more human-readable & editable & fixing bug introduced in r364987
llvm-svn: 365417
2019-07-09 01:11:02 +00:00
Yuanfang Chen
63f6faa850 Teach the symbolizer lib symbolize objects directly.
Currently, the symbolizer lib can only symbolize a file on disk.
This patch teaches the symbolizer lib to symbolize objects.
llvm-objdump needs this to support archive disassembly with source info.

https://bugs.llvm.org/show_bug.cgi?id=41871

Reviewed by: jhenderson, grimar, MaskRay

Differential Revision: https://reviews.llvm.org/D63521

llvm-svn: 365376
2019-07-08 19:28:57 +00:00
Nilanjana Basu
4b3d4276c6 Revert Changing CodeView debug info type record representation in assembly files to make it more human-readable & editable
This reverts r364982 (git commit 2082bf28ebea76cc187b508f801122866420d9ff)

llvm-svn: 364987
2019-07-03 00:51:49 +00:00
Nilanjana Basu
4c0bbf540e Changing CodeView debug info type record representation in assembly files to make it more human-readable & editable
llvm-svn: 364982
2019-07-03 00:26:23 +00:00
Igor Kudrin
a8593263e5 [DWARF] Simplify dumping of a .debug_addr section.
This patch removes the part which tried to interpret addresses
in that section as offsets and simplifies the remaining code.

Differential Revision: https://reviews.llvm.org/D64020

llvm-svn: 364896
2019-07-02 09:57:28 +00:00
Fangrui Song
0d1da5593c Cleanup: llvm::bsearch -> llvm::partition_point after r364719
llvm-svn: 364720
2019-06-30 11:19:56 +00:00
Fangrui Song
3c005f1680 [DebugInfo] Simplify GSYM::AddressRange and GSYM::AddressRanges
Delete unnecessary getters of AddressRange.
Simplify AddressRange::size(): Start <= End check should be checked in an upper layer.
Delete isContiguousWith() that doesn't make sense.
Simplify AddressRanges::insert. Delete commented code. Fix it when more than 1 ranges are to be deleted.
Delete trailing newline.

llvm-svn: 364637
2019-06-28 10:06:11 +00:00
Fangrui Song
693b277806 [DebugInfo] GSYM cleanups after D63104/r364427
llvm-svn: 364634
2019-06-28 08:58:05 +00:00
Michael Liao
0a09ab5d03 Correct the file path. NFC.
llvm-svn: 364577
2019-06-27 19:05:46 +00:00
Djordje Todorovic
a77a0a3548 [DWARF] Handle the DW_OP_entry_value operand
Add the IR and the AsmPrinter parts for handling of the DW_OP_entry_values
DWARF operation.

([11/13] Introduce the debug entry values.)

Co-authored-by: Ananth Sowda <asowda@cisco.com>
Co-authored-by: Nikola Prica <nikola.prica@rt-rk.com>
Co-authored-by: Ivan Baev <ibaev@cisco.com>

Differential Revision: https://reviews.llvm.org/D60866

llvm-svn: 364542
2019-06-27 13:52:34 +00:00
Greg Clayton
43125c87f3 Fix builbots after r364427.
I was using an iterator that was equal to the end of a collection.

llvm-svn: 364447
2019-06-26 16:22:58 +00:00
Michael Liao
3941b967c3 Fix build in shared lib mode.
- The newly added GSYM misses LLVMBuild.txt. Add a barely one to pass
  the build.

llvm-svn: 364440
2019-06-26 15:46:48 +00:00
Greg Clayton
4e92f3ef15 Add GSYM utility files along with unit tests.
The full GSYM patch started with: https://reviews.llvm.org/D53379

In that patch we wanted to split up getting GSYM into the LLVM code base so we are not committing too much code at once.

This is a first in a series of patches where I only add the foundation classes along with complete unit tests. They provide the foundation for encoding and decoding a GSYM file.

File entries are defined in llvm::gsym::FileEntry. This class splits the file up into a directory and filename represented by uniqued string table offsets. This allows all files that are referred to in a GSYM file to be encoded as 1 based indexes into a global file table in the GSYM file.

Function information in stored in llvm::gsym::FunctionInfo. This object represents a contiguous address range that has a name and range with an optional line table and inline call stack information.

Line table entries are defined in llvm::gsym::LineEntry. They store only address, file and line information to keep the line tables simple and allows the information to be efficiently encoded in a subsequent patch.

Inline information is defined in llvm::gsym::InlineInfo. These structs store the name of the inline function, along with one or more address ranges, and the file and line that called this function. They also contain any child inline information.

There are also utility classes for address ranges in llvm::gsym::AddressRange, and string table support in llvm::gsym::StringTable which are simple classes.

The unit tests test all the APIs on these simple classes so they will be ready for the next patches where we will create GSYM files and parse GSYM files.

Differential Revision: https://reviews.llvm.org/D63104

llvm-svn: 364427
2019-06-26 14:09:09 +00:00