Files
clang-p2996/lldb/source/Plugins/ObjectFile/PECOFF/CMakeLists.txt
Alvin Wong 25c8a061c5 [lldb] Set COFF module ABI from default triple and make it an option
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.

* Fixes https://github.com/llvm/llvm-project/issues/50775
* Fixes https://github.com/mstorsjo/llvm-mingw/issues/226
* Fixes https://github.com/mstorsjo/llvm-mingw/issues/282

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D127048
2022-06-09 22:43:33 +03:00

35 lines
875 B
CMake

# Dbghelp is used on windows for writing minidump files.
if(WIN32)
set(DBGHELP_LINK_FILES dbghelp)
else()
set(DBGHELP_LINK_FILES "")
endif()
lldb_tablegen(ObjectFilePECOFFProperties.inc -gen-lldb-property-defs
SOURCE ObjectFilePECOFFProperties.td
TARGET LLDBPluginObjectFilePECOFFPropertiesGen)
lldb_tablegen(ObjectFilePECOFFPropertiesEnum.inc -gen-lldb-property-enum-defs
SOURCE ObjectFilePECOFFProperties.td
TARGET LLDBPluginObjectFilePECOFFPropertiesEnumGen)
add_lldb_library(lldbPluginObjectFilePECOFF PLUGIN
ObjectFilePECOFF.cpp
PECallFrameInfo.cpp
WindowsMiniDump.cpp
LINK_LIBS
lldbCore
lldbHost
lldbSymbol
lldbTarget
${DBGHELP_LINK_FILES}
LINK_COMPONENTS
BinaryFormat
Support
)
add_dependencies(lldbPluginObjectFilePECOFF
LLDBPluginObjectFilePECOFFPropertiesGen
LLDBPluginObjectFilePECOFFPropertiesEnumGen)