You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
fhahn
changed the title
crash for "x86_64-w64-windows-gnu" because of architecture triple mismatch - solution proposition
lldb crash for "x86_64-w64-windows-gnu" because of architecture triple mismatch - solution proposition
Apr 11, 2022
PE/COFF can use either MSVC or GNU (MinGW) ABI for C++ code, however
LLDB had defaulted to MSVC implicitly with no way to override it. This
causes issues when debugging modules built with the GNU ABI, sometimes
even crashes.
This changes the PE/COFF plugin to set the module triple according to
the default target triple used to build LLDB. If the default target
triple is Windows and a valid environment is specified, then this
environment will be used for the module spec. This not only works for
MSVC and GNU, but also other environments.
A new setting, `plugin.object-file.pe-coff.abi`, has been added to
allow overriding this default ABI.
* Fixesllvm/llvm-project#50775
* Fixesmstorsjo/llvm-mingw#226
* Fixesmstorsjo/llvm-mingw#282
Reviewed By: omjavaid
Differential Revision: https://reviews.llvm.org/D127048
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:
break;
case MachineX86:
The text was updated successfully, but these errors were encountered: