diff --git a/lldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.cpp b/lldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.cpp --- a/lldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.cpp +++ b/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()) { diff --git a/lldb/test/Shell/ObjectFile/PDB/object.test b/lldb/test/Shell/ObjectFile/PDB/object.test --- a/lldb/test/Shell/ObjectFile/PDB/object.test +++ b/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