From a73b7df7de3ef7e21ca716369da33d66db79ead4 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Tue, 6 Mar 2012 23:42:15 +0000 Subject: Using the new ScriptInterpreterObject in the implementation of synthetic children to enhance type safety Several places in the ScriptInterpreter interface used StringList objects where an std::string would suffice - Fixed Refactoring calls that generated special-purposes functions in the Python interpreter to use helper functions instead of duplicating blobs of code llvm-svn: 152164 --- lldb/source/Commands/CommandObjectCommands.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'lldb/source/Commands/CommandObjectCommands.cpp') diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index bb928d5..c881a6f 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -1571,33 +1571,25 @@ private: out_stream->Flush(); return; } - StringList funct_name_sl; + std::string funct_name_str; if (!interpreter->GenerateScriptAliasFunction (m_user_input, - funct_name_sl)) + funct_name_str)) { out_stream->Printf ("Unable to create function: no script attached.\n"); out_stream->Flush(); return; } - if (funct_name_sl.GetSize() == 0) + if (funct_name_str.empty()) { out_stream->Printf ("Unable to obtain a function name: no script attached.\n"); out_stream->Flush(); return; } - const char *funct_name = funct_name_sl.GetStringAtIndex(0); - if (!funct_name || !funct_name[0]) - { - out_stream->Printf ("Invalid function name: no script attached.\n"); - out_stream->Flush(); - return; - } - // everything should be fine now, let's add this alias CommandObjectSP command_obj_sp(new CommandObjectPythonFunction(m_interpreter, m_cmd_name, - funct_name, + funct_name_str.c_str(), m_synchronous)); if (!m_interpreter.AddUserCommand(m_cmd_name, command_obj_sp, true)) -- cgit v1.1