diff options
author | Med Ismail Bennani <medismail.bennani@gmail.com> | 2023-01-09 20:26:19 -0800 |
---|---|---|
committer | Med Ismail Bennani <medismail.bennani@gmail.com> | 2023-01-12 12:49:05 -0800 |
commit | 2d53527e9c64c70c24e1abba74fa0a8c8b3392b1 (patch) | |
tree | 9d629efec95e7633675765fa301768d60603e4cb /lldb/source/API/SBDebugger.cpp | |
parent | 3fbc89048517e7152cce763db3b1e5738d558113 (diff) | |
download | llvm-2d53527e9c64c70c24e1abba74fa0a8c8b3392b1.zip llvm-2d53527e9c64c70c24e1abba74fa0a8c8b3392b1.tar.gz llvm-2d53527e9c64c70c24e1abba74fa0a8c8b3392b1.tar.bz2 |
[lldb] Add Debugger & ScriptedMetadata reference to Platform::CreateInstance
This patch is preparatory work for Scripted Platform support and does
multiple things:
First, it introduces new options for the `platform select` command and
`SBPlatform::Create` API, to hold a reference to the debugger object,
the name of the python script managing the Scripted Platform and a
structured data dictionary that the user can use to pass arbitrary data.
Then, it updates the various `Create` and `GetOrCreate` methods for
the `Platform` and `PlatformList` classes to pass down the new parameter
to the `Platform::CreateInstance` callbacks.
Finally, it updates every callback to reflect these changes.
Differential Revision: https://reviews.llvm.org/D139249
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Diffstat (limited to 'lldb/source/API/SBDebugger.cpp')
-rw-r--r-- | lldb/source/API/SBDebugger.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp index 851c80a..743e928 100644 --- a/lldb/source/API/SBDebugger.cpp +++ b/lldb/source/API/SBDebugger.cpp @@ -1498,7 +1498,8 @@ SBError SBDebugger::SetCurrentPlatform(const char *platform_name_cstr) { if (m_opaque_sp) { if (platform_name_cstr && platform_name_cstr[0]) { PlatformList &platforms = m_opaque_sp->GetPlatformList(); - if (PlatformSP platform_sp = platforms.GetOrCreate(platform_name_cstr)) + if (PlatformSP platform_sp = platforms.GetOrCreate( + platform_name_cstr, /*metadata = */ nullptr)) platforms.SetSelectedPlatform(platform_sp); else sb_error.ref().SetErrorString("platform not found"); |