Give `frame recognizer add -l` a formal ScriptedStackFrameRecognizerInterface, matching the architecture already used by ScriptedProcess, ScriptedBreakpoint, etc.: a C++ interface header, a Python-backed implementation built on ScriptedPythonInterface's CreatePluginObject/Dispatch machinery, PluginManager registration, and a generatable Python ABC template (scripted_stackframe_recognizer.py). get_recognized_arguments' documented contract returns a plain list of lldb.SBValue (not an lldb.SBValueList), so it bypasses the generic Dispatch<ValueObjectListSP>() extractor and calls the SWIG bridge directly, matching the legacy behavior exactly. ScriptedStackFrameRecognizer now holds a single interface object created once in its constructor and reused across every RecognizeFrame() call, same lifecycle as before. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma> (cherry picked from commit a07b91d8243b8a8051dbbe5739eacc7942269c61)
47 lines
1.7 KiB
C++
47 lines
1.7 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/lldb-enumerations.h"
|
|
|
|
#include "ScriptInterpreterPythonInterfaces.h"
|
|
|
|
using namespace lldb;
|
|
using namespace lldb_private;
|
|
|
|
llvm::StringRef
|
|
ScriptInterpreterPythonInterfaces::GetPluginDescriptionStatic() {
|
|
return "Script Interpreter Python Interfaces";
|
|
}
|
|
|
|
void ScriptInterpreterPythonInterfaces::Initialize() {
|
|
OperatingSystemPythonInterface::Initialize();
|
|
ScriptedPlatformPythonInterface::Initialize();
|
|
ScriptedProcessPythonInterface::Initialize();
|
|
ScriptedHookPythonInterface::Initialize();
|
|
ScriptedBreakpointPythonInterface::Initialize();
|
|
ScriptedThreadPlanPythonInterface::Initialize();
|
|
ScriptedFrameProviderPythonInterface::Initialize();
|
|
ScriptedThreadPythonInterface::Initialize();
|
|
ScriptedFramePythonInterface::Initialize();
|
|
ScriptedStackFrameRecognizerPythonInterface::Initialize();
|
|
}
|
|
|
|
void ScriptInterpreterPythonInterfaces::Terminate() {
|
|
OperatingSystemPythonInterface::Terminate();
|
|
ScriptedPlatformPythonInterface::Terminate();
|
|
ScriptedProcessPythonInterface::Terminate();
|
|
ScriptedHookPythonInterface::Terminate();
|
|
ScriptedBreakpointPythonInterface::Terminate();
|
|
ScriptedThreadPlanPythonInterface::Terminate();
|
|
ScriptedFrameProviderPythonInterface::Terminate();
|
|
ScriptedThreadPythonInterface::Terminate();
|
|
ScriptedFramePythonInterface::Terminate();
|
|
ScriptedStackFrameRecognizerPythonInterface::Terminate();
|
|
}
|