This patch extends ScriptedFrame to work with real (non-scripted) threads, enabling frame providers to synthesize frames for native processes. Previously, ScriptedFrame only worked within ScriptedProcess/ScriptedThread contexts. This patch decouples ScriptedFrame from ScriptedThread, allowing users to augment or replace stack frames in real debugging sessions for use cases like custom calling conventions, reconstructing corrupted frames from core files, or adding diagnostic frames. Key changes: - ScriptedFrame::Create() now accepts ThreadSP instead of requiring ScriptedThread, extracting architecture from the target triple rather than ScriptedProcess.arch - Added SBTarget::RegisterScriptedFrameProvider() and ClearScriptedFrameProvider() APIs, with Target storing a SyntheticFrameProviderDescriptor template for new threads - Added "target frame-provider register/clear" commands for CLI access - Thread class gains LoadScriptedFrameProvider(), ClearScriptedFrameProvider(), and GetFrameProvider() methods for per-thread frame provider management - New SyntheticStackFrameList overrides FetchFramesUpTo() to lazily provide frames from either the frame provider or the real stack This enables practical use of the SyntheticFrameProvider infrastructure in real debugging workflows. rdar://161834688 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma> Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
48 lines
1.6 KiB
C++
48 lines
1.6 KiB
C++
//===-- ScriptInterpreterPythonInterfaces.cpp -----------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "lldb/Core/PluginManager.h"
|
|
#include "lldb/Host/Config.h"
|
|
#include "lldb/lldb-enumerations.h"
|
|
|
|
#if LLDB_ENABLE_PYTHON
|
|
|
|
#include "ScriptInterpreterPythonInterfaces.h"
|
|
|
|
using namespace lldb;
|
|
using namespace lldb_private;
|
|
|
|
LLDB_PLUGIN_DEFINE(ScriptInterpreterPythonInterfaces)
|
|
|
|
llvm::StringRef
|
|
ScriptInterpreterPythonInterfaces::GetPluginDescriptionStatic() {
|
|
return "Script Interpreter Python Interfaces";
|
|
}
|
|
|
|
void ScriptInterpreterPythonInterfaces::Initialize() {
|
|
OperatingSystemPythonInterface::Initialize();
|
|
ScriptedPlatformPythonInterface::Initialize();
|
|
ScriptedProcessPythonInterface::Initialize();
|
|
ScriptedStopHookPythonInterface::Initialize();
|
|
ScriptedBreakpointPythonInterface::Initialize();
|
|
ScriptedThreadPlanPythonInterface::Initialize();
|
|
ScriptedFrameProviderPythonInterface::Initialize();
|
|
}
|
|
|
|
void ScriptInterpreterPythonInterfaces::Terminate() {
|
|
OperatingSystemPythonInterface::Terminate();
|
|
ScriptedPlatformPythonInterface::Terminate();
|
|
ScriptedProcessPythonInterface::Terminate();
|
|
ScriptedStopHookPythonInterface::Terminate();
|
|
ScriptedBreakpointPythonInterface::Terminate();
|
|
ScriptedThreadPlanPythonInterface::Terminate();
|
|
ScriptedFrameProviderPythonInterface::Terminate();
|
|
}
|
|
|
|
#endif
|