307 Commits

Author SHA1 Message Date
Nilanjana Basu
65de1d1004 Removing block comments from CodeView records in assembly files & related code cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369860 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-25 01:09:11 +00:00
Nilanjana Basu
c3faebe4b8 Improving CodeView debug info type record's inline comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369533 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-21 15:19:58 +00:00
Nilanjana Basu
c132cb0db6 Changing representation of .cv_def_range directives in Codeview debug info assembly format for better readability
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367867 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-05 14:16:58 +00:00
Nilanjana Basu
e1c95d270d Revert "Changing representation of .cv_def_range directives in Codeview debug info assembly format for better readability"
This reverts commit a885afa9fa8cab3b34f1ddf3d21535f88b662881.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367861 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-05 13:55:21 +00:00
Nilanjana Basu
ed8791f244 Changing representation of .cv_def_range directives in Codeview debug info assembly format for better readability
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367850 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-05 13:11:51 +00:00
Eric Christopher
b9ccc5854b 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367707 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-02 19:10:37 +00:00
Nilanjana Basu
fec0188416 Changing representation of cv_def_range directives in Codeview debug info assembly format for better readability
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367704 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-02 18:44:39 +00:00
Eric Christopher
0927bf13d7 Temporarily revert "Changes to improve CodeView debug info type record inline comments"
due to a sanitizer failure.

This reverts commit 367623.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367640 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-02 01:05:47 +00:00
Nilanjana Basu
8a1fd9ee0c Changes to improve CodeView debug info type record inline comments
Signed-off-by: Nilanjana Basu <nilanjana.basu87@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367623 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-01 22:05:14 +00:00
Nilanjana Basu
c9afcce4ec Changes to emit CodeView debug info nested type records properly using MCStreamer directives
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366720 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-22 18:22:55 +00:00
Nilanjana Basu
587d5442ae Changes to display code view debug info type records in hex format
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366390 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-17 23:43:58 +00:00
Nilanjana Basu
932274efb6 Adding inline comments to code view type record directives for better readability
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366372 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-17 21:01:12 +00:00
Nico Weber
8ac74ba9ef 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!)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365789 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-11 15:26:45 +00:00
Nilanjana Basu
2a69e2802f Changing CodeView debug info type record representation in assembly files to make it more human-readable & editable & fixing bug introduced in r364987
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365417 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-09 01:11:02 +00:00
Nilanjana Basu
c2427c2dc9 Revert Changing CodeView debug info type record representation in assembly files to make it more human-readable & editable
This reverts r364982 (git commit 2082bf28ebea76cc187b508f801122866420d9ff)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364987 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-03 00:51:49 +00:00
Nilanjana Basu
e94c493e8c Changing CodeView debug info type record representation in assembly files to make it more human-readable & editable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364982 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-03 00:26:23 +00:00
Tom Tan
e8d62a350e [COFF, ARM64] Add CodeView register mapping
CodeView has its own register map which is defined in cvconst.h. Missing this
mapping before saving register to CodeView causes debugger to show incorrect
value for all register based variables, like variables in register and local
variables addressed by register (stack pointer + offset).

This change added mapping between LLVM register and CodeView register so the
correct register number will be stored to CodeView/PDB, it aso fixed the
mapping from CodeView register number to register name based on current
CPUType but print PDB to yaml still assumes X86 CPU and needs to be fixed.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362280 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-31 23:43:31 +00:00
Galina Kistanova
35e2e8d045 Reverted r361134 because of a failing test left unattended for a long time.
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/17792/steps/test-check-all/logs/stdio
Failing Tests (1):
    LLVM :: CodeGen/AMDGPU/regbank-reassign.mir


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361430 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-22 20:42:56 +00:00
Fangrui Song
1bf2855bbf Use llvm::sort. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361134 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-20 10:18:35 +00:00
Reid Kleckner
6def39bfec [codeview] Finish support for reading and writing S_ANNOTATION records
Implement dumping via llvm-pdbutil and llvm-readobj.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360813 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-15 20:53:39 +00:00
Reid Kleckner
27775cd11b [codeview] Remove Type member from CVRecord
Summary:
Now CVType and CVSymbol are effectively type-safe wrappers around
ArrayRef<uint8_t>. Make the kind() accessor load it from the
RecordPrefix, which is the same for types and symbols.

Reviewers: zturner, aganea

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357658 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-04 00:28:48 +00:00
Reid Kleckner
983ff6b359 [llvm-pdbutil] Add -type-ref-stats to help find unused type info
Summary:
This considers module symbol streams and the global symbol stream to be
roots. Most types that this considers "unreferenced" are referenced by
LF_UDT_MOD_SRC_LINE id records, which VC seems to always include.
Essentially, they are types that the user can only find in the debugger
if they call them by name, they cannot be found by traversing a symbol.

In practice, around 80% of type information in a PDB is referenced by a
symbol. That seems like a reasonable number.

I don't really plan to do anything with this tool. It mostly just exists
for informational purposes, and to confirm that we probably don't need
to implement type reference tracking in LLD. We can continue to merge
all types as we do today without wasting space.

Reviewers: zturner, aganea

Subscribers: mgorny, hiraditya, arphaman, jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356692 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-21 18:02:34 +00:00
Nathan Lanza
e348e5023a Add Swift enumerator value for CodeView::SourceLanguage
Summary:
Swift now generates PDBs for debugging on Windows. llvm and lldb
need a language enumerator value too properly handle the output
emitted by swiftc.

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355882 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-11 23:27:59 +00:00
Benjamin Kramer
e258a80393 Move some classes into anonymous namespaces. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353710 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-11 15:16:21 +00:00
Alexandre Ganea
29400a2fb2 [CodeView] Fix cycles in debug info when merging Types with global hashes
When type streams with forward references were merged using GHashes, cycles 
were introduced in the debug info. This was caused by 
GlobalTypeTableBuilder::insertRecordAs() not inserting the record on the second
pass, thus yielding an empty ArrayRef at that record slot. Later on, upon PDB 
emission, TpiStreamBuilder::commit() would skip that empty record, thus 
offseting all indices that came after in the stream. 

This solution comes in two steps: 

1. Fix the hash calculation, by doing a multiple-step resolution, iff there are
forward references in the input stream.
2. Fix merge by resolving with multiple passes, therefore moving records with
forward references at the end of the stream. 

This patch also adds support for llvm-readoj --codeview-ghash.
Finally, fix dumpCodeViewMergedTypes() which previously could reference deleted
memory. 

Fixes PR40221 

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353412 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-07 15:24:18 +00:00
Chandler Carruth
6b547686c5 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 08:50:56 +00:00
Alexandre Ganea
c5ca54a30f [CodeView] More appropriate name and type for a Microsoft precompiled headers parameter. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350520 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-07 13:53:16 +00:00
Zachary Turner
a8e4afaa8d [PDB] Add some helper functions for working with scopes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349361 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-17 16:15:36 +00:00
Zachary Turner
11255059ae [NativePDB] Reconstruct function declarations from debug info.
Previously we would create an lldb::Function object for each function
parsed, but we would not add these to the clang AST. This is a first
step towards getting local variable support working, as we first need an
AST decl so that when we create local variable entries, they have the
proper DeclContext.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348631 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-07 19:34:02 +00:00
Zachary Turner
a6cf7e3664 [PDB] Move some code around. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348505 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-06 17:49:15 +00:00
Zachary Turner
32cfa0e63b Support skewed stream arrays.
VarStreamArray was built on the assumption that it is backed by a
StreamRef, and offset 0 of that StreamRef is the first byte of the first
record in the array.

This is a logical and intuitive assumption, but unfortunately we have
use cases where it doesn't hold. Specifically, a PDB module's symbol
stream is prefixed by 4 bytes containing a magic value, and the first
byte of record data in the array is actually at offset 4 of this byte
sequence.

Previously, we would just truncate the first 4 bytes and then construct
the VarStreamArray with the resulting StreamRef, so that offset 0 of the
underlying stream did correspond to the first byte of the first record,
but this is problematic, because symbol records reference other symbol
records by the absolute offset including that initial magic 4 bytes. So
if another record wants to refer to the first record in the array, it
would say "the record at offset 4".

This led to extremely confusing hacks and semantics in loading code, and
after spending 30 minutes trying to get some math right and failing, I
decided to fix this in the underlying implementation of VarStreamArray.
Now, we can say that a stream is skewed by a particular amount. This
way, when we access a record by absolute offset, we can use the same
values that the records themselves contain, instead of having to do
fixups.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348499 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-06 16:55:00 +00:00
Zachary Turner
9213bb9bc8 [CodeView] Add support for ref-qualified member functions.
When you have a member function with a ref-qualifier, for example:

struct Foo {
  void Func() &;
  void Func2() &&;
};

clang-cl was not emitting this information. Doing so is a bit
awkward, because it's not a property of the LF_MFUNCTION type, which
is what you'd expect. Instead, it's a property of the this pointer
which is actually an LF_POINTER. This record has an attributes
bitmask on it, and our handling of this bitmask was all wrong. We
had some parts of the bitmask defined incorrectly, but importantly
for this bug, we didn't know about these extra 2 bits that represent
the ref qualifier at all.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347354 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-20 22:13:43 +00:00
Zachary Turner
941c5c4811 [CodeView] Don't print PointerAttributes when dumping.
PointerAttributes is a bitwise-or of several other fields, each of
which is already printed on its own line with a better explanation.
So this doesn't really help much.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347275 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-20 00:10:27 +00:00
Zachary Turner
3546f90aac [NativePDB] Improved support for nested type reconstruction.
In a previous patch, we pre-processed the TPI stream in order to build
the reverse mapping from nested type -> parent type so that we could
accurately reconstruct a DeclContext hierarchy.

However, there were some issues. An LF_NESTTYPE record is really just a
typedef, so although it happens to be used to indicate the name of the
nested type and referring to the global record which defines the type,
it is also used for every other kind of nested typedef. When we rebuild
the DeclContext hierarchy, we want it to be as accurate as possible,
which means that if we have something like:

  struct A {
    struct B {};
    using C = B;
  };

We don't want to create two CXXRecordDecls in the AST each with the
exact same definition. We just want to create one for B and then
define C as an alias to B. Previously, however, it would not be able
to distinguish between the two cases and it would treat A::B and
A::C as being two classes each with separate definitions. We address
the first half of improving the pre-processing logic so that only
actual definitions are treated this way.

Later, in a followup patch, we can handle the case of nested
typedefs since we're already going to be enumerating the field list
anyway and this patch introduces the general framework for
distinguishing between the two cases.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346786 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-13 20:07:32 +00:00
Alexandre Ganea
4a52ea2ea2 [COFF][LLD] Add link support for Microsoft precompiled headers OBJs
This change allows for link-time merging of debugging information from
Microsoft precompiled types OBJs compiled with cl.exe /Z7 /Yc and /Yu.

This fixes llvm.org/PR34278

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346154 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-05 19:20:47 +00:00
Reid Kleckner
a754e02f2a [codeview] Add breaks to fix -Wimplicit-fallthrough
This is a minor bug fix. Previously, if you tried to encode the RSP
register on the x86 platform, that might have succeeded and been encoded
incorrectly. However, no existing producer or consumer passes the x86_64
registers when targeting x86_32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345879 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-01 19:36:29 +00:00
Zachary Turner
fd25d2bf30 [CodeView] Emit the correct TypeIndex for std::nullptr_t.
The TypeIndex used by cl.exe is 0x103, which indicates a SimpleTypeMode
of NearPointer (note the absence of the bitness, normally pointers use a
mode of NearPointer32 or NearPointer64) and a SimpleTypeKind of void.
So this is basically a void*, but without a specified size, which makes
sense given how std::nullptr_t is defined.

clang-cl was actually not emitting *anything* for this. Instead, when we
encountered std::nullptr_t in a DIType, we would actually just emit a
TypeIndex of 0, which is obviously wrong.

std::nullptr_t in DWARF is represented as a DW_TAG_unspecified_type with
a name of "decltype(nullptr)", so we add that logic along with a test,
as well as an update to the dumping code so that we no longer print
void* when dumping 0x103 (which would previously treat Void/NearPointer
no differently than Void/NearPointer64).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345811 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-01 04:02:41 +00:00
Zachary Turner
25a2b438a4 Fix a compilation failure on non-MSVC compilers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343952 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-08 04:34:41 +00:00
Zachary Turner
cffc876a14 [PDB] Add the ability to lookup global symbols by name.
The Globals table is a hash table keyed on symbol name, so
it's possible to lookup symbols by name in O(1) time.  Add
a function to the globals stream to do this, and add an option
to llvm-pdbutil to exercise this, then use it to write some
tests to verify correctness.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343951 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-08 04:19:16 +00:00
Reid Kleckner
6d4c271eeb [codeview] Emit S_FRAMEPROC and use S_DEFRANGE_FRAMEPOINTER_REL
Summary:
Before this change, LLVM would always describe locals on the stack as
being relative to some specific register, RSP, ESP, EBP, ESI, etc.
Variables in stack memory are pretty common, so there is a special
S_DEFRANGE_FRAMEPOINTER_REL symbol for them. This change uses it to
reduce the size of our debug info.

On top of the size savings, there are cases on 32-bit x86 where local
variables are addressed from ESP, but ESP changes across the function.
Unlike in DWARF, there is no FPO data to describe the stack adjustments
made to push arguments onto the stack and pop them off after the call,
which makes it hard for the debugger to find the local variables in
frames further up the stack.

To handle this, CodeView has a special VFRAME register, which
corresponds to the $T0 variable set by our FPO data in 32-bit.  Offsets
to local variables are instead relative to this value.

This is part of PR38857.

Reviewers: hans, zturner, javed.absar

Subscribers: aprantl, hiraditya, JDevlieghere, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343543 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 21:59:45 +00:00
Fangrui Song
3b35e17b21 llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...)
Summary: The convenience wrapper in STLExtras is available since rL342102.

Reviewers: dblaikie, javed.absar, JDevlieghere, andreadb

Subscribers: MatzeB, sanjoy, arsenm, dschuff, mehdi_amini, sdardis, nemanjai, jvesely, nhaehnle, sbc100, jgravelle-google, eraman, aheejin, kbarton, JDevlieghere, javed.absar, gbedwell, jrtc27, mgrang, atanasyan, steven_wu, george.burgess.iv, dexonsmith, kristina, jsji, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343163 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-27 02:13:45 +00:00
Zachary Turner
9b6c494a00 [PDB] Add native reading support for UDT / class types.
This allows the native reader to find records of class/struct/
union type and dump them.  This behavior is tested by using the
diadump subcommand against golden output produced by actual DIA
SDK on the same PDB file, and again using pretty -native to
confirm that we actually dump the classes.  We don't find class
members or anything like that yet, for now it's just the class
itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342779 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-21 22:36:04 +00:00
Zachary Turner
77a6888b3d [PDB] Write FPO Data to the PDB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342003 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-11 22:35:01 +00:00
Reid Kleckner
b73f47d91f [codeview] Decode and dump FP regs from S_FRAMEPROC records
Summary:
There are two registers encoded in the S_FRAMEPROC flags: one for locals
and one for parameters. The encoding is described by the
ExpandEncodedBasePointerReg function in cvinfo.h. Two bits are used to
indicate one of four possible values:

  0: no register - Used when there are no variables.
  1: SP / standard - Variables are stored relative to the standard SP
     for the ISA.
  2: FP - Variables are addressed relative to the ISA frame
     pointer, i.e. EBP on x86. If realignment is required, parameters
     use this. If a dynamic alloca is used, locals will be EBP relative.
  3: Alternative - Variables are stored relative to some alternative
     third callee-saved register. This is required to address highly
     aligned locals when there are dynamic stack adjustments. In this
     case, both the incoming SP saved in the standard FP and the current
     SP are at some dynamic offset from the locals. LLVM uses ESI in
     this case, MSVC uses EBX.

Most of the changes in this patch are to pass around the CPU so that we
can decode these into real, named architectural registers.

Subscribers: hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341999 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-11 22:00:50 +00:00
Alexandre Ganea
0444f57668 [DebugInfo] Common behavior for error types
Following D50807, and heading towards D50664, this intermediary change does the following:

1. Upgrade all custom Error types in llvm/trunk/lib/DebugInfo/ to use the new StringError behavior (D50807).
2. Implement std::is_error_code_enum and make_error_code() for DebugInfo error enumerations.
3. Rename GenericError -> PDBError (the file will be renamed in a subsequent commit)
4. Update custom error messages to follow the same formatting: (\w\s*)+\.
5. Keep generic "file not found" (ENOENT) errors as they are in PDB code. Previously, there used to be a custom enumeration for that purpose.
6. Remove a few extraneous LF in log() implementations. Printing LF is a responsability at a higher level, not at the error level.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341228 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-31 17:41:58 +00:00
Alexandre Ganea
a7336f2922 [CodeView] Minimal support for S_UNAMESPACE records
Differential Revision: https://reviews.llvm.org/D50007


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338417 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-31 19:15:50 +00:00
Alexandre Ganea
1715f28483 This fixes a crash when a second pass is required for the Codeview Type merging *and* the index points outside of the table (which should lead to an error being printed).
This occurs currently until MS precompiled headers .obj is added (see D45213)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338308 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30 21:14:25 +00:00
Zachary Turner
7ce035b534 [CodeView] Correctly compute the name of S_PROCREF symbols.
We have a function which switches on the type of a symbol record
to return a hardcoded offset into the record that contains the
symbol name.  Not all symbols have names to begin with, and for
those records we return -1 for the offset.

Names are used for various things.  Importantly for this particular
bug, a hash of the record name is used as a key for certain hash
tables which are serialied into the PDB file.  One of these hash
tables is for the global symbol stream, which is basically a
collection of S_PROCREF symbols which contain the name of the
symbol, a module, and an address offset.

However, for S_PROCREF symbols, the function to return the offset
of the name was returning -1: basically it wasn't implemented.
As a result of this, all global symbols were hashing to the same
value, essentially it was as if every single global symbol's name
was the empty string.

This manifests in the VS debugger when you try to call a function
(global or member, doesn't matter) through the immediate window
and the debugger simply reports an error because it can't find the
function.  This makes perfect sense, because it is hashing the name
for real, looking in the global symbol hash table, and there is only
1 entry there which corresponds to a symbol whose name is the empty
string.

Fixing this fixes the MSVC debugger in this case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336024 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-29 22:19:02 +00:00
Zachary Turner
b26b734118 Resubmit [pdb] Change /DEBUG:GHASH to emit 8 byte hashes."
This fixes the remaining failing tests, so resubmitting with no
functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332676 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-17 22:55:15 +00:00
Zachary Turner
761b193f29 Revert "[pdb] Change /DEBUG:GHASH to emit 8 byte hashes."
A few tests haven't been properly updated, so reverting while
I have time to investigate proper fixes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332672 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-17 21:49:25 +00:00