[lldb] Reland 2402b3213c with /H to debug the windows build issue

This patch relands 2402b3213c to investigate the ambigious typedef
issue happening on the windows bots:

https://lab.llvm.org/buildbot/#/builders/141/builds/1175/

However this patch adds the `/H` compiler flag when building
the ScriptedProcessPythonInterface library to be able to investigate the
include order issue.

This patch will be revert after 1 failing run on the windows bot.

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
This commit is contained in:
Med Ismail Bennani
2024-07-30 19:54:11 -07:00
parent f65fa5461d
commit e72cdae47b
5 changed files with 72 additions and 12 deletions

View File

@@ -21,7 +21,6 @@ endif()
add_lldb_library(lldbPluginScriptInterpreterPythonInterfaces
ScriptedPythonInterface.cpp
ScriptedProcessPythonInterface.cpp
ScriptedThreadPythonInterface.cpp
LINK_LIBS
@@ -38,5 +37,13 @@ add_lldb_library(lldbPluginScriptInterpreterPythonInterfaces
add_subdirectory(OperatingSystemPythonInterface)
add_subdirectory(ScriptedPlatformPythonInterface)
if (WIN32)
set(ORIGINAL_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${ORIGINAL_CMAKE_CXX_FLAGS} /H")
endif()
add_subdirectory(ScriptedProcessPythonInterface)
if (WIN32)
set(CMAKE_CXX_FLAGS "${ORIGINAL_CMAKE_CXX_FLAGS}")
endif()
add_subdirectory(ScriptedThreadPlanPythonInterface)

View File

@@ -0,0 +1,16 @@
add_lldb_library(lldbPluginScriptInterpreterPythonScriptedProcessPythonInterface PLUGIN
ScriptedProcessPythonInterface.cpp
LINK_LIBS
lldbCore
lldbHost
lldbInterpreter
lldbTarget
lldbPluginScriptInterpreterPython
${Python3_LIBRARIES}
${LLDB_LIBEDIT_LIBS}
LINK_COMPONENTS
Support
)

View File

@@ -6,11 +6,8 @@
//
//===----------------------------------------------------------------------===//
#include "lldb/Core/PluginManager.h"
#include "lldb/Host/Config.h"
#if LLDB_ENABLE_PYTHON
// LLDB Python header must be included first
#include "../lldb-python.h"
#endif
#include "lldb/Target/Process.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Status.h"
@@ -18,10 +15,16 @@
#if LLDB_ENABLE_PYTHON
#include "../SWIGPythonBridge.h"
#include "../ScriptInterpreterPythonImpl.h"
// clang-format off
// LLDB Python header must be included first
#include "../../lldb-python.h"
//clang-format on
#include "../../SWIGPythonBridge.h"
#include "../../ScriptInterpreterPythonImpl.h"
#include "../ScriptedThreadPythonInterface.h"
#include "ScriptedProcessPythonInterface.h"
#include "ScriptedThreadPythonInterface.h"
#include <optional>
using namespace lldb;
@@ -29,6 +32,8 @@ using namespace lldb_private;
using namespace lldb_private::python;
using Locker = ScriptInterpreterPythonImpl::Locker;
LLDB_PLUGIN_DEFINE_ADV(ScriptedProcessPythonInterface, ScriptInterpreterPythonScriptedProcessPythonInterface)
ScriptedProcessPythonInterface::ScriptedProcessPythonInterface(
ScriptInterpreterPythonImpl &interpreter)
: ScriptedProcessInterface(), ScriptedPythonInterface(interpreter) {}
@@ -208,4 +213,24 @@ StructuredData::DictionarySP ScriptedProcessPythonInterface::GetMetadata() {
return dict;
}
void ScriptedProcessPythonInterface::Initialize() {
const std::vector<llvm::StringRef> ci_usages = {
"process attach -C <script-name> [-k key -v value ...]",
"process launch -C <script-name> [-k key -v value ...]"};
const std::vector<llvm::StringRef> api_usages = {
"SBAttachInfo.SetScriptedProcessClassName",
"SBAttachInfo.SetScriptedProcessDictionary",
"SBTarget.Attach",
"SBLaunchInfo.SetScriptedProcessClassName",
"SBLaunchInfo.SetScriptedProcessDictionary",
"SBTarget.Launch"};
PluginManager::RegisterPlugin(
GetPluginNameStatic(), llvm::StringRef("Mock process state"),
CreateInstance, eScriptLanguagePython, {ci_usages, api_usages});
}
void ScriptedProcessPythonInterface::Terminate() {
PluginManager::UnregisterPlugin(CreateInstance);
}
#endif

View File

@@ -10,16 +10,18 @@
#define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPROCESSPYTHONINTERFACE_H
#include "lldb/Host/Config.h"
#include "lldb/Interpreter/Interfaces/ScriptedProcessInterface.h"
#if LLDB_ENABLE_PYTHON
#include "ScriptedPythonInterface.h"
#include "lldb/Interpreter/Interfaces/ScriptedProcessInterface.h"
#include "../ScriptedPythonInterface.h"
#include <optional>
namespace lldb_private {
class ScriptedProcessPythonInterface : public ScriptedProcessInterface,
public ScriptedPythonInterface {
public ScriptedPythonInterface,
public PluginInterface {
public:
ScriptedProcessPythonInterface(ScriptInterpreterPythonImpl &interpreter);
@@ -67,6 +69,16 @@ public:
StructuredData::DictionarySP GetMetadata() override;
static void Initialize();
static void Terminate();
static llvm::StringRef GetPluginNameStatic() {
return "ScriptedProcessPythonInterface";
}
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
private:
lldb::ScriptedThreadInterfaceSP CreateScriptedThreadInterface() override;
};

View File

@@ -16,7 +16,7 @@
#include "Interfaces/OperatingSystemPythonInterface/OperatingSystemPythonInterface.h"
#include "Interfaces/ScriptedPlatformPythonInterface/ScriptedPlatformPythonInterface.h"
#include "Interfaces/ScriptedProcessPythonInterface.h"
#include "Interfaces/ScriptedProcessPythonInterface/ScriptedProcessPythonInterface.h"
#include "Interfaces/ScriptedThreadPlanPythonInterface/ScriptedThreadPlanPythonInterface.h"
#include "PythonDataObjects.h"
#include "PythonReadline.h"