[Lldb-commits] [PATCH] D152189: [LLDB][PDB] Fix age field in UUID in PDB file.

Zequan Wu via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 6 08:24:55 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGcb9a7c22ee67: [LLDB][PDB] Fix age field in UUID in PDB file. (authored by zequanwu).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152189/new/

https://reviews.llvm.org/D152189

Files:
  lldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.cpp
  lldb/test/Shell/ObjectFile/PDB/object.test


Index: lldb/test/Shell/ObjectFile/PDB/object.test
===================================================================
--- lldb/test/Shell/ObjectFile/PDB/object.test
+++ lldb/test/Shell/ObjectFile/PDB/object.test
@@ -3,7 +3,7 @@
 
 # CHECK: Plugin name: pdb
 # CHECK: Architecture: x86_64-pc-windows-msvc
-# CHECK: UUID: 61AF583F-29A8-7A6C-4C4C-44205044422E-00000001
+# CHECK: UUID: 61AF583F-29A8-7A6C-4C4C-44205044422E-00000003
 # CHECK: Executable: false
 # CHECK: Stripped: false
 # CHECK: Type: debug info
@@ -52,7 +52,7 @@
   Version:         VC70
 DbiStream:
   VerHeader:       V70
-  Age:             1
+  Age:             3
   BuildNumber:     36363
   PdbDllVersion:   0
   PdbDllRbld:      0
Index: lldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.cpp
===================================================================
--- lldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.cpp
+++ lldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.cpp
@@ -27,10 +27,10 @@
 
 LLDB_PLUGIN_DEFINE(ObjectFilePDB)
 
-static UUID GetPDBUUID(InfoStream &IS) {
+static UUID GetPDBUUID(InfoStream &IS, DbiStream &DS) {
   UUID::CvRecordPdb70 debug_info;
   memcpy(&debug_info.Uuid, IS.getGuid().Guid, sizeof(debug_info.Uuid));
-  debug_info.Age = IS.getAge();
+  debug_info.Age = DS.getAge();
   return UUID(debug_info);
 }
 
@@ -82,7 +82,12 @@
     llvm::consumeError(info_stream.takeError());
     return false;
   }
-  m_uuid = GetPDBUUID(*info_stream);
+  auto dbi_stream = m_file_up->getPDBDbiStream();
+  if (!dbi_stream) {
+    llvm::consumeError(dbi_stream.takeError());
+    return false;
+  }
+  m_uuid = GetPDBUUID(*info_stream, *dbi_stream);
   return true;
 }
 
@@ -126,7 +131,7 @@
   }
 
   lldb_private::UUID &uuid = module_spec.GetUUID();
-  uuid = GetPDBUUID(*info_stream);
+  uuid = GetPDBUUID(*info_stream, *dbi_stream);
 
   ArchSpec &module_arch = module_spec.GetArchitecture();
   switch (dbi_stream->getMachineType()) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152189.528880.patch
Type: text/x-patch
Size: 1926 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230606/cff50d7b/attachment-0001.bin>


More information about the lldb-commits mailing list