summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-08-14 18:44:58 +0000
committerZachary Turner <zturner@google.com>2017-08-14 18:44:58 +0000
commit302dc8bccffe6a047f22fac456cf2bb4871beedc (patch)
tree56420d5d97c962709223dd54679b20cdd6e6d8be
parent451ef4adcd3118d27456d24810390621317cceba (diff)
downloadbcm5719-llvm-302dc8bccffe6a047f22fac456cf2bb4871beedc.tar.gz
bcm5719-llvm-302dc8bccffe6a047f22fac456cf2bb4871beedc.zip
[PDB] Ignore all S_UDT symbols when writing PDBs.
We don't have the right algorithm for copying S_UDT symbols from object files to the globals stream, and having it wrong is worse than not having it at all, since it breaks display of local variables of UDT types (for example, "dv Foo" fails in our current implementation, but succeeds if the S_UDT records are omitted). Omit them until we fix the algorithm. llvm-svn: 310867
-rw-r--r--lld/COFF/PDB.cpp8
-rw-r--r--lld/test/COFF/pdb-globals.test6
-rw-r--r--lld/test/COFF/pdb-symbol-types.yaml4
-rw-r--r--lld/test/COFF/pdb-type-server-simple.test6
4 files changed, 9 insertions, 15 deletions
diff --git a/lld/COFF/PDB.cpp b/lld/COFF/PDB.cpp
index 8e891cfe241..29cf7b521a3 100644
--- a/lld/COFF/PDB.cpp
+++ b/lld/COFF/PDB.cpp
@@ -483,7 +483,6 @@ static bool symbolGoesInModuleStream(const CVSymbol &Sym) {
static bool symbolGoesInGlobalsStream(const CVSymbol &Sym) {
switch (Sym.kind()) {
case SymbolKind::S_CONSTANT:
- case SymbolKind::S_UDT:
case SymbolKind::S_GDATA32:
// S_LDATA32 goes in both the module stream and the globals stream.
case SymbolKind::S_LDATA32:
@@ -495,6 +494,13 @@ static bool symbolGoesInGlobalsStream(const CVSymbol &Sym) {
case SymbolKind::S_PROCREF:
case SymbolKind::S_LPROCREF:
return true;
+ // FIXME: For now, we drop all S_UDT symbols (i.e. they don't go in the
+ // globals stream or the modules stream). These have special handling which
+ // needs more investigation before we can get right, but by putting them all
+ // into the globals stream WinDbg fails to display local variables of class
+ // types saying that it cannot find the type Foo *. So as a stopgap just to
+ // keep things working, we drop them.
+ case SymbolKind::S_UDT:
default:
return false;
}
diff --git a/lld/test/COFF/pdb-globals.test b/lld/test/COFF/pdb-globals.test
index b3b0f63d0dc..b5e4f49cb45 100644
--- a/lld/test/COFF/pdb-globals.test
+++ b/lld/test/COFF/pdb-globals.test
@@ -15,22 +15,18 @@ RUN: llvm-pdbutil dump -symbols -globals %t.pdb | FileCheck %s
CHECK-LABEL: Global Symbols
CHECK-NEXT: ============================================================
CHECK-NEXT: Records
-CHECK-NEXT: 340 | S_UDT [size = 20] `HelloPoint`
-CHECK-NEXT: original type = 0x1007
CHECK-NEXT: 160 | S_PROCREF [size = 28] `GlobalFunc`
CHECK-NEXT: module = 1, sum name = 0, offset = 52
CHECK-NEXT: 188 | S_PROCREF [size = 20] `main`
CHECK-NEXT: module = 1, sum name = 0, offset = 108
CHECK-NEXT: 208 | S_LPROCREF [size = 24] `LocalFunc`
CHECK-NEXT: module = 1, sum name = 0, offset = 292
-CHECK-NEXT: 360 | S_PROCREF [size = 40] `HelloPoint::HelloPoint`
+CHECK-NEXT: 312 | S_PROCREF [size = 40] `HelloPoint::HelloPoint`
CHECK-NEXT: module = 1, sum name = 0, offset = 376
CHECK-NEXT: 232 | S_GDATA32 [size = 28] `__purecall`
CHECK-NEXT: type = 0x0403 (void*), addr = 0000:0000
CHECK-NEXT: 260 | S_GDATA32 [size = 24] `GlobalVar`
CHECK-NEXT: type = 0x100B (const int*), addr = 0001:0000
-CHECK-NEXT: 312 | S_UDT [size = 28] `HelloPointTypedef`
-CHECK-NEXT: original type = 0x1005
CHECK-NEXT: 284 | S_LDATA32 [size = 28] `ConstantVar`
CHECK-NEXT: type = 0x100A (const int), addr = 0002:0000
diff --git a/lld/test/COFF/pdb-symbol-types.yaml b/lld/test/COFF/pdb-symbol-types.yaml
index 34ac92fb7de..9dad72d3cc2 100644
--- a/lld/test/COFF/pdb-symbol-types.yaml
+++ b/lld/test/COFF/pdb-symbol-types.yaml
@@ -18,10 +18,6 @@
# CHECK-NEXT: Records
# CHECK-NEXT: 48 | S_PROCREF [size = 20] `main`
# CHECK-NEXT: module = 1, sum name = 0, offset = 116
-# CHECK-NEXT: 96 | S_UDT [size = 16] `UDT_Foo`
-# CHECK-NEXT: original type = 0x1004
-# CHECK-NEXT: 112 | S_UDT [size = 12] `Foo`
-# CHECK-NEXT: original type = 0x1004
# CHECK-NEXT: 68 | S_GDATA32 [size = 28] `global_foo`
# CHECK-NEXT: type = 0x1004 (Foo), addr = 0001:0000
diff --git a/lld/test/COFF/pdb-type-server-simple.test b/lld/test/COFF/pdb-type-server-simple.test
index dcefef55223..238b483a3d7 100644
--- a/lld/test/COFF/pdb-type-server-simple.test
+++ b/lld/test/COFF/pdb-type-server-simple.test
@@ -64,12 +64,8 @@ CHECK: ============================================================
CHECK-NEXT: Records
CHECK-NEXT: 36 | S_PROCREF [size = 20] `main`
CHECK-NEXT: module = 1, sum name = 0, offset = 104
-CHECK-NEXT: 68 | S_PROCREF [size = 16] `g`
+CHECK-NEXT: 56 | S_PROCREF [size = 16] `g`
CHECK-NEXT: module = 2, sum name = 0, offset = 104
-CHECK-NEXT: 56 | S_UDT [size = 12] `Foo`
-CHECK-NEXT: original type = 0x1006
-CHECK-NEXT: 84 | S_UDT [size = 12] `Foo`
-CHECK-NEXT: original type = 0x1006
CHECK-LABEL: Symbols
CHECK: ============================================================
OpenPOWER on IntegriCloud