diff options
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpointCommand.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectCommands.cpp | 16 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectType.cpp | 45 |
3 files changed, 18 insertions, 47 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp index a7e98eaf06b..5ab93d72632 100644 --- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp @@ -422,7 +422,7 @@ CommandObjectBreakpointCommandAdd::SetBreakpointCommandCallback (BreakpointOptio // The former is used to generate callback description (as in breakpoint command list) // while the latter is used for Python to interpret during the actual callback. data_ap->user_source.AppendString (oneliner); - data_ap->script_source.AppendString (oneliner); + data_ap->script_source.assign (oneliner); data_ap->stop_on_error = m_options.m_stop_on_error; BatonSP baton_sp (new BreakpointOptions::CommandBaton (data_ap.release())); @@ -499,7 +499,7 @@ CommandObjectBreakpointCommandAdd::GenerateBreakpointCommandCallback if (bp_options_baton) { ((BreakpointOptions::CommandData *) bp_options_baton->m_data)->user_source.Clear(); - ((BreakpointOptions::CommandData *) bp_options_baton->m_data)->script_source.Clear(); + ((BreakpointOptions::CommandData *) bp_options_baton->m_data)->script_source.clear(); } } if (!batch_mode) 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)) diff --git a/lldb/source/Commands/CommandObjectType.cpp b/lldb/source/Commands/CommandObjectType.cpp index 90fdafca17f..0de6d9b4af7 100644 --- a/lldb/source/Commands/CommandObjectType.cpp +++ b/lldb/source/Commands/CommandObjectType.cpp @@ -824,32 +824,25 @@ public: out_stream->Flush(); return; } - StringList funct_name_sl; + std::string funct_name_str; if (!interpreter->GenerateTypeScriptFunction (options->m_user_source, - funct_name_sl)) + funct_name_str)) { out_stream->Printf ("Internal error #3: no script attached.\n"); out_stream->Flush(); return; } - if (funct_name_sl.GetSize() == 0) + if (funct_name_str.empty()) { out_stream->Printf ("Internal error #4: 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 ("Internal error #5: no script attached.\n"); - out_stream->Flush(); - return; - } // now I have a valid function name, let's add this as script for every type in the list TypeSummaryImplSP script_format; script_format.reset(new ScriptSummaryFormat(options->m_flags, - funct_name, + funct_name_str.c_str(), options->m_user_source.CopyList(" ").c_str())); Error error; @@ -1068,32 +1061,25 @@ CommandObjectTypeSummaryAdd::Execute_ScriptSummary (Args& command, CommandReturn } StringList funct_sl; funct_sl << m_options.m_python_script.c_str(); - StringList funct_name_sl; + std::string funct_name_str; if (!interpreter->GenerateTypeScriptFunction (funct_sl, - funct_name_sl)) + funct_name_str)) { result.AppendError ("Internal error #2Q: no script attached.\n"); result.SetStatus (eReturnStatusFailed); return false; } - if (funct_name_sl.GetSize() == 0) + if (funct_name_str.empty()) { result.AppendError ("Internal error #3Q: no script attached.\n"); result.SetStatus (eReturnStatusFailed); return false; } - const char *funct_name = funct_name_sl.GetStringAtIndex(0); - if (!funct_name || !funct_name[0]) - { - result.AppendError ("Internal error #4Q: no script attached.\n"); - result.SetStatus (eReturnStatusFailed); - return false; - } std::string code = " " + m_options.m_python_script; script_format.reset(new ScriptSummaryFormat(m_options.m_flags, - funct_name, + funct_name_str.c_str(), code.c_str())); } else // use an InputReader to grab Python code from the user @@ -3314,27 +3300,20 @@ public: out_stream->Flush(); return; } - StringList class_name_sl; + std::string class_name_str; if (!interpreter->GenerateTypeSynthClass (options->m_user_source, - class_name_sl)) + class_name_str)) { out_stream->Printf ("Internal error #3: no script attached.\n"); out_stream->Flush(); return; } - if (class_name_sl.GetSize() == 0) + if (class_name_str.empty()) { out_stream->Printf ("Internal error #4: no script attached.\n"); out_stream->Flush(); return; } - const char *class_name = class_name_sl.GetStringAtIndex(0); - if (!class_name || !class_name[0]) - { - out_stream->Printf ("Internal error #5: no script attached.\n"); - out_stream->Flush(); - return; - } // everything should be fine now, let's add the synth provider class @@ -3342,7 +3321,7 @@ public: synth_provider.reset(new TypeSyntheticImpl(SyntheticChildren::Flags().SetCascades(options->m_cascade). SetSkipPointers(options->m_skip_pointers). SetSkipReferences(options->m_skip_references), - class_name)); + class_name_str.c_str())); lldb::TypeCategoryImplSP category; |