summaryrefslogtreecommitdiffstats
path: root/source/API/SBDebugger.cpp
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2015-02-06 21:38:51 +0000
committeremaste <emaste@FreeBSD.org>2015-02-06 21:38:51 +0000
commit0c2019f4ca6b2dc6d710f6bb16a0e3ed10271531 (patch)
tree09bc83f73246ee3c7a779605cd0122093d2a8a19 /source/API/SBDebugger.cpp
parent01ee1789d6aa7294e5966a97f8d29387f6f81699 (diff)
downloadFreeBSD-src-0c2019f4ca6b2dc6d710f6bb16a0e3ed10271531.zip
FreeBSD-src-0c2019f4ca6b2dc6d710f6bb16a0e3ed10271531.tar.gz
Import LLDB as of upstream SVN r225923 (git 2b588ecd)
This corresponds with the branchpoint for the 3.6 release. A number of files not required for the FreeBSD build have been removed. Sponsored by: DARPA, AFRL
Diffstat (limited to 'source/API/SBDebugger.cpp')
-rw-r--r--source/API/SBDebugger.cpp71
1 files changed, 58 insertions, 13 deletions
diff --git a/source/API/SBDebugger.cpp b/source/API/SBDebugger.cpp
index dae5675..a95f2ff 100644
--- a/source/API/SBDebugger.cpp
+++ b/source/API/SBDebugger.cpp
@@ -715,16 +715,13 @@ SBDebugger::CreateTarget (const char *filename)
TargetSP target_sp;
if (m_opaque_sp)
{
- ArchSpec arch = Target::GetDefaultArchitecture ();
Error error;
const bool add_dependent_modules = true;
-
- PlatformSP platform_sp(m_opaque_sp->GetPlatformList().GetSelectedPlatform());
- error = m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp,
+ error = m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp,
filename,
- arch,
+ NULL,
add_dependent_modules,
- platform_sp,
+ NULL,
target_sp);
if (error.Success())
@@ -972,7 +969,32 @@ SBDebugger::RunCommandInterpreter (bool auto_handle_events,
bool spawn_thread)
{
if (m_opaque_sp)
- m_opaque_sp->GetCommandInterpreter().RunCommandInterpreter(auto_handle_events, spawn_thread);
+ {
+ CommandInterpreterRunOptions options;
+
+ m_opaque_sp->GetCommandInterpreter().RunCommandInterpreter(auto_handle_events,
+ spawn_thread,
+ options);
+ }
+}
+
+void
+SBDebugger::RunCommandInterpreter (bool auto_handle_events,
+ bool spawn_thread,
+ SBCommandInterpreterRunOptions &options,
+ int &num_errors,
+ bool &quit_requested,
+ bool &stopped_for_crash)
+
+{
+ if (m_opaque_sp)
+ {
+ CommandInterpreter &interp = m_opaque_sp->GetCommandInterpreter();
+ interp.RunCommandInterpreter(auto_handle_events, spawn_thread, options.ref());
+ num_errors = interp.GetNumErrors();
+ quit_requested = interp.GetQuitRequested();
+ stopped_for_crash = interp.GetStoppedForCrash();
+ }
}
void
@@ -1186,19 +1208,42 @@ SBDebugger::GetID()
SBError
-SBDebugger::SetCurrentPlatform (const char *platform_name)
+SBDebugger::SetCurrentPlatform (const char *platform_name_cstr)
{
SBError sb_error;
if (m_opaque_sp)
{
- PlatformSP platform_sp (Platform::Create (platform_name, sb_error.ref()));
-
- if (platform_sp)
+ if (platform_name_cstr && platform_name_cstr[0])
{
- bool make_selected = true;
- m_opaque_sp->GetPlatformList().Append (platform_sp, make_selected);
+ ConstString platform_name (platform_name_cstr);
+ PlatformSP platform_sp (Platform::Find (platform_name));
+
+ if (platform_sp)
+ {
+ // Already have a platform with this name, just select it
+ m_opaque_sp->GetPlatformList().SetSelectedPlatform(platform_sp);
+ }
+ else
+ {
+ // We don't have a platform by this name yet, create one
+ platform_sp = Platform::Create (platform_name, sb_error.ref());
+ if (platform_sp)
+ {
+ // We created the platform, now append and select it
+ bool make_selected = true;
+ m_opaque_sp->GetPlatformList().Append (platform_sp, make_selected);
+ }
+ }
+ }
+ else
+ {
+ sb_error.ref().SetErrorString("invalid platform name");
}
}
+ else
+ {
+ sb_error.ref().SetErrorString("invalid debugger");
+ }
return sb_error;
}
OpenPOWER on IntegriCloud