diff options
author | Raphael Isemann <teemperor@gmail.com> | 2018-07-12 22:28:52 +0000 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2018-07-12 22:28:52 +0000 |
commit | 4d51a90297d34389b53c00c5cd6fa6f73998c298 (patch) | |
tree | fb8d42ce62a2a5e7bff1c397626c774ce51e3fee /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h | |
parent | 3a1347721454c50c0f06cdf99388b8d38a49c408 (diff) | |
download | llvm-4d51a90297d34389b53c00c5cd6fa6f73998c298.zip llvm-4d51a90297d34389b53c00c5cd6fa6f73998c298.tar.gz llvm-4d51a90297d34389b53c00c5cd6fa6f73998c298.tar.bz2 |
Get rid of the C-string parameter in DoExecute
Summary:
This patch gets rid of the C-string parameter in the RawCommandObject::DoExecute function,
making the code simpler and less memory unsafe.
There seems to be a assumption in some command objects that this parameter could be a nullptr,
but from what I can see the rest of the API doesn't actually allow this (and other command
objects and related code pieces dereference this parameter without any checks).
Especially CommandObjectRegexCommand has error handling code for a nullptr that is now gone.
Reviewers: davide, jingham, teemperor
Reviewed By: teemperor
Subscribers: jingham, lldb-commits
Differential Revision: https://reviews.llvm.org/D49207
llvm-svn: 336955
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h index 628b71f..b13979d 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h @@ -151,14 +151,14 @@ public: bool Interrupt() override; bool ExecuteOneLine( - const char *command, CommandReturnObject *result, + llvm::StringRef command, CommandReturnObject *result, const ExecuteScriptOptions &options = ExecuteScriptOptions()) override; void ExecuteInterpreterLoop() override; bool ExecuteOneLineWithReturn( - const char *in_string, ScriptInterpreter::ScriptReturnType return_type, - void *ret_value, + llvm::StringRef in_string, + ScriptInterpreter::ScriptReturnType return_type, void *ret_value, const ExecuteScriptOptions &options = ExecuteScriptOptions()) override; lldb_private::Status ExecuteMultipleLines( @@ -259,18 +259,17 @@ public: GetSyntheticTypeName(const StructuredData::ObjectSP &implementor) override; bool - RunScriptBasedCommand(const char *impl_function, const char *args, + RunScriptBasedCommand(const char *impl_function, llvm::StringRef args, ScriptedCommandSynchronicity synchronicity, lldb_private::CommandReturnObject &cmd_retobj, Status &error, const lldb_private::ExecutionContext &exe_ctx) override; - bool - RunScriptBasedCommand(StructuredData::GenericSP impl_obj_sp, const char *args, - ScriptedCommandSynchronicity synchronicity, - lldb_private::CommandReturnObject &cmd_retobj, - Status &error, - const lldb_private::ExecutionContext &exe_ctx) override; + bool RunScriptBasedCommand( + StructuredData::GenericSP impl_obj_sp, llvm::StringRef args, + ScriptedCommandSynchronicity synchronicity, + lldb_private::CommandReturnObject &cmd_retobj, Status &error, + const lldb_private::ExecutionContext &exe_ctx) override; Status GenerateFunction(const char *signature, const StringList &input) override; |