[lldb-dev] [Bug 51433] New: crash for "x86_64-w64-windows-gnu" because of architecture triple mismatch - solution proposition

2021-08-10 Thread via lldb-dev
https://bugs.llvm.org/show_bug.cgi?id=51433

Bug ID: 51433
   Summary: crash for  "x86_64-w64-windows-gnu" because of
architecture triple mismatch - solution proposition
   Product: lldb
   Version: 12.0
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: enhancement
  Priority: P
 Component: All Bugs
  Assignee: lldb-dev@lists.llvm.org
  Reporter: rol...@gmail.com
CC: jdevliegh...@apple.com, llvm-b...@lists.llvm.org

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 0x4550 // 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
+   spec.SetTriple("x86_64-pc-windows");
 specs.Append(module_spec);
 break;
   case MachineX86:

-- 
You are receiving this mail because:
You are the assignee for the bug.___
lldb-dev mailing list
lldb-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


[lldb-dev] [Bug 51418] Please backport 15cacab73f7e36d9dca4a5516ccb360b67bf2dbc (skip test if LD_PRELOAD) to 13.x

2021-08-10 Thread via lldb-dev
https://bugs.llvm.org/show_bug.cgi?id=51418

Tom Stellard  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Fixed By Commit(s)|15cacab73f7e36d9dca4a5516cc |15cacab73f7e36d9dca4a5516cc
   |b360b67bf2dbc   |b360b67bf2dbc bf742f285094
 Status|NEW |RESOLVED

--- Comment #1 from Tom Stellard  ---
Merged: bf742f285094

-- 
You are receiving this mail because:
You are the assignee for the bug.___
lldb-dev mailing list
lldb-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


[lldb-dev] [Bug 51423] Please backport 614c7d03877fd99c2de47429b15be3f00306a3bd (LLVM_LIT_ARGS override) to 13.x

2021-08-10 Thread via lldb-dev
https://bugs.llvm.org/show_bug.cgi?id=51423

Tom Stellard  changed:

   What|Removed |Added

 Fixed By Commit(s)|614c7d03877fd99c2de47429b15 |614c7d03877fd99c2de47429b15
   |be3f00306a3bd   |be3f00306a3bd 8c1ca94ad27e
 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #1 from Tom Stellard  ---
Merged: 8c1ca94ad27e

-- 
You are receiving this mail because:
You are the assignee for the bug.___
lldb-dev mailing list
lldb-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev