summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/interface
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2014-10-11 00:38:27 +0000
committerJim Ingham <jingham@apple.com>2014-10-11 00:38:27 +0000
commit26c7bf9312939025f710bd4c4e0174488da25c7c (patch)
treea4c57cdaba6967e417a24316a9d92f932dbf01f9 /lldb/scripts/Python/interface
parent41c79d934ba10ba61beef70534ec3fed410f5ab0 (diff)
downloadbcm5719-llvm-26c7bf9312939025f710bd4c4e0174488da25c7c.tar.gz
bcm5719-llvm-26c7bf9312939025f710bd4c4e0174488da25c7c.zip
Rework the way we pass "run multiple command" options to the various API's that
do that (RunCommandInterpreter, HandleCommands, HandleCommandsFromFile) to gather the options into an options class. Also expose that to the SB API's. Change the way the "-o" options to the lldb driver are processed so: 1) They are run synchronously - didn't really make any sense to run the asynchronously. 2) The stop on error 3) "quit" in one of the -o commands will not quit lldb - not the command interpreter that was running the -o commands. I added an entry to the run options to stop-on-crash, but I haven't implemented that yet. llvm-svn: 219553
Diffstat (limited to 'lldb/scripts/Python/interface')
-rw-r--r--lldb/scripts/Python/interface/SBCommandInterpreter.i65
-rw-r--r--lldb/scripts/Python/interface/SBDebugger.i8
2 files changed, 70 insertions, 3 deletions
diff --git a/lldb/scripts/Python/interface/SBCommandInterpreter.i b/lldb/scripts/Python/interface/SBCommandInterpreter.i
index 9dc842e87c2..856038094f7 100644
--- a/lldb/scripts/Python/interface/SBCommandInterpreter.i
+++ b/lldb/scripts/Python/interface/SBCommandInterpreter.i
@@ -10,6 +10,71 @@
namespace lldb {
%feature("docstring",
+"SBCommandInterpreterRunOptions controls how the RunCommandInterpreter runs the code it is fed.
+A default SBCommandInterpreterRunOptions object has:
+ StopOnContinue: false
+ StopOnError: false
+ StopOnCrash: false
+ EchoCommands: true
+ PrintResults: true
+ AddToHistory: true
+
+
+") SBCommandInterpreterRunOptions;
+class SBCommandInterpreterRunOptions
+{
+friend class SBDebugger;
+public:
+ SBCommandInterpreterRunOptions();
+ ~SBCommandInterpreterRunOptions();
+
+ bool
+ GetStopOnContinue () const;
+
+ void
+ SetStopOnContinue (bool);
+
+ bool
+ GetStopOnError () const;
+
+ void
+ SetStopOnError (bool);
+
+ bool
+ GetStopOnCrash () const;
+
+ void
+ SetStopOnCrash (bool);
+
+ bool
+ GetEchoCommands () const;
+
+ void
+ SetEchoCommands (bool);
+
+ bool
+ GetPrintResults () const;
+
+ void
+ SetPrintResults (bool);
+
+ bool
+ GetAddToHistory () const;
+
+ void
+ SetAddToHistory (bool);
+private:
+ lldb_private::CommandInterpreterRunOptions *
+ get () const;
+
+ lldb_private::CommandInterpreterRunOptions &
+ ref () const;
+
+ // This is set in the constructor and will always be valid.
+ mutable std::unique_ptr<lldb_private::CommandInterpreterRunOptions> m_opaque_up;
+};
+
+%feature("docstring",
"SBCommandInterpreter handles/interprets commands for lldb. You get the
command interpreter from the SBDebugger instance. For example (from test/
python_api/interpreter/TestCommandInterpreterAPI.py),
diff --git a/lldb/scripts/Python/interface/SBDebugger.i b/lldb/scripts/Python/interface/SBDebugger.i
index ba1c18914e3..fb63fc362dc 100644
--- a/lldb/scripts/Python/interface/SBDebugger.i
+++ b/lldb/scripts/Python/interface/SBDebugger.i
@@ -363,11 +363,13 @@ public:
lldb::SBTypeSynthetic
GetSyntheticForType (lldb::SBTypeNameSpecifier);
-
+
void
RunCommandInterpreter (bool auto_handle_events,
- bool spawn_thread);
-
+ bool spawn_thread,
+ SBCommandInterpreterRunOptions &options,
+ int &num_errors,
+ bool &quit_requested);
}; // class SBDebugger
} // namespace lldb
OpenPOWER on IntegriCloud