-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Description
Bugzilla Link | 51433 |
Version | 12.0 |
OS | Windows NT |
Attachments | the crash backtrace |
Reporter | LLVM Bugzilla Contributor |
CC | @cristianadam,@JDevlieghere |
Extended Description
The problem concerns the 64bit lldb (12.0.01 and 14.0.0) debugger compiled for "x86_64-w64-windows-gnu".
The debugger crashes if a variable of type class method pointer is examined.
Debugging of the lldb shown the problem is a result of the architecture "triple" mismatch, and a difference in the implementation of class method pointers between "msvc" and "gnu".
The triplet lldb for debugged exe file obtains the by method "ObjectFilePECOFF::GetModuleSpecifications"
and sets it to "x86_64-pc-windows". Finally the triplet is transformed to ""x86_64-pc-windows.msvc" by Triple::normalize at the clang side.
It seems to be reasonable to resolve the problem at its origin, by replacing the wrong hard coded triple value, in "ObjectFilePECOFF:: GetModuleSpecifications" to the proper one, by using some additional criteria.
Here is the patch:
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
index 9eb1c25d2403..61550682a019 100644
--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -32,6 +32,7 @@
#include "llvm/Object/COFFImportFile.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/MemoryBuffer.h"
+#include "llvm/Support/Host.h"
#define IMAGE_DOS_SIGNATURE 0x5A4D // MZ
#define IMAGE_NT_SIGNATURE 0x00004550 // PE00
@@ -163,7 +164,10 @@ size_t ObjectFilePECOFF::GetModuleSpecifications(
switch (COFFObj->getMachine()) {
case MachineAmd64:
- spec.SetTriple("x86_64-pc-windows");
-
if(llvm::sys::getProcessTriple()=="x86_64-w64-windows-gnu")
-
spec.SetTriple("x86_64-w64-windows-gnu");
-
else
-
specs.Append(module_spec);
spec.SetTriple("x86_64-pc-windows");
break;
case MachineX86: