Skip to content

Commit ccff927

Browse files
Alexander Yermolovichkusmour
authored andcommitted
[LLDB][ROAR] Initial checkin of ROAR JIT plugin.
Summary: -- Initial commit of ROARJITLoader. -- Added an API to get location spec. This is can be used by custom JITLoader to handle HandleBreakpointBySourceLocation. -- Modifies LLDB to allow external plugins to have access to internal process state via the public API. This is necessary for some plugins that should be part of LLDB (because they need access to internal LLDB state) but for some reason cannot be linked against LLDB. Test Plan: ninja check-lldb Rollback Plan: Reviewers: jpporto, gclayton, #lldb_team, royshi Reviewed By: jpporto, gclayton Differential Revision: https://phabricator.intern.facebook.com/D77634915 Tasks: T227178858
1 parent 53f20aa commit ccff927

File tree

10 files changed

+1385
-1
lines changed

10 files changed

+1385
-1
lines changed

lldb/include/lldb/Breakpoint/BreakpointResolverFileLine.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ class BreakpointResolverFileLine : public BreakpointResolver {
5656
lldb::BreakpointResolverSP
5757
CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override;
5858

59+
/// Get the location spec that this resolver is using.
60+
const SourceLocationSpec &GetLocationSpec() const { return m_location_spec; }
61+
5962
protected:
6063
void FilterContexts(SymbolContextList &sc_list);
6164
void DeduceSourceMapping(const SymbolContextList &sc_list);

lldb/include/lldb/Target/Process.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,15 @@ class Process : public std::enable_shared_from_this<Process>,
937937

938938
const lldb::UnixSignalsSP &GetUnixSignals();
939939

940+
/// Called by LLDB before calling an external plugin that needs access to
941+
/// internal process state using the public API.
942+
void WillCallExternalPlugin() { m_making_external_plugin_call = true; }
943+
944+
/// Called by LLDB after a call to an external plugin that needs access to
945+
/// internal process state using the public API returns, thus restoring the
946+
/// public API behavior to the default.
947+
void DoneCallingExternalPlugin() { m_making_external_plugin_call = false; }
948+
940949
//==================================================================
941950
// Plug-in Process Control Overrides
942951
//==================================================================
@@ -3271,6 +3280,10 @@ void PruneThreadPlans();
32713280
/// GetExtendedCrashInformation.
32723281
StructuredData::DictionarySP m_crash_info_dict_sp;
32733282

3283+
/// Set to true before calling an external plugin that needs access to
3284+
/// internal process state.
3285+
bool m_making_external_plugin_call = false;
3286+
32743287
size_t RemoveBreakpointOpcodesFromBuffer(lldb::addr_t addr, size_t size,
32753288
uint8_t *buf) const;
32763289

lldb/source/Plugins/JITLoader/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ set_property(DIRECTORY PROPERTY LLDB_PLUGIN_KIND JITLoader)
22
set_property(DIRECTORY PROPERTY LLDB_TOLERATED_PLUGIN_DEPENDENCIES ObjectFile)
33

44
add_subdirectory(GDB)
5+
add_subdirectory(ROAR)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
lldb_tablegen(JITLoaderROARProperties.inc -gen-lldb-property-defs
2+
SOURCE JITLoaderROARProperties.td
3+
TARGET LLDBPluginJITLoaderROARPropertiesGen)
4+
5+
lldb_tablegen(JITLoaderROARPropertiesEnum.inc -gen-lldb-property-enum-defs
6+
SOURCE JITLoaderROARProperties.td
7+
TARGET LLDBPluginJITLoaderROARPropertiesEnumGen)
8+
9+
add_lldb_library(lldbPluginJITLoaderROAR PLUGIN
10+
JITLoaderROAR.cpp
11+
12+
LINK_LIBS
13+
lldbBreakpoint
14+
lldbCore
15+
lldbInterpreter
16+
lldbSymbol
17+
lldbTarget
18+
lldbUtility
19+
lldbPluginObjectFileMachO
20+
LINK_COMPONENTS
21+
Support
22+
)
23+
24+
add_dependencies(lldbPluginJITLoaderROAR
25+
LLDBPluginJITLoaderROARPropertiesGen
26+
LLDBPluginJITLoaderROARPropertiesEnumGen)
27+
28+
target_include_directories(lldbPluginJITLoaderROAR PRIVATE "${CMAKE_SOURCE_DIR}/../roar/include")

0 commit comments

Comments
 (0)