summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectCommands.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2012-03-06 23:42:15 +0000
committerEnrico Granata <egranata@apple.com>2012-03-06 23:42:15 +0000
commita73b7df7de3ef7e21ca716369da33d66db79ead4 (patch)
tree45dd1817617c374d511ba4cb382a68dd21becbad /lldb/source/Commands/CommandObjectCommands.cpp
parent5022f1dffede35aa231cde3f81c65e8d9d7969fc (diff)
downloadbcm5719-llvm-a73b7df7de3ef7e21ca716369da33d66db79ead4.tar.gz
bcm5719-llvm-a73b7df7de3ef7e21ca716369da33d66db79ead4.zip
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
Diffstat (limited to 'lldb/source/Commands/CommandObjectCommands.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectCommands.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index bb928d5b765..c881a6feea6 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))
OpenPOWER on IntegriCloud