From 6eee5aa0671b8aea82930424ac11fceaba809bd3 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Mon, 11 Oct 2010 01:05:37 +0000 Subject: Added a "--no-lldbinit" option (-n for short (which magically matches what gdb uses)) so we can tell our "lldb" driver program to not automatically parse any .lldbinit files. llvm-svn: 116179 --- lldb/source/Commands/CommandObjectBreakpoint.cpp | 115 ++++++++++++----------- 1 file changed, 58 insertions(+), 57 deletions(-) (limited to 'lldb/source/Commands/CommandObjectBreakpoint.cpp') diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index a648581cb81..e7cf0a8bb95 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -309,78 +309,79 @@ CommandObjectBreakpointSet::Execute switch (break_type) { case eSetTypeFileAndLine: // Breakpoint by source position - { - FileSpec file; - if (m_options.m_filename.empty()) { - StackFrame *cur_frame = m_interpreter.GetDebugger().GetExecutionContext().frame; - if (cur_frame == NULL) - { - result.AppendError ("Attempting to set breakpoint by line number alone with no selected frame."); - result.SetStatus (eReturnStatusFailed); - break; - } - else if (!cur_frame->HasDebugInformation()) - { - result.AppendError ("Attempting to set breakpoint by line number alone but selected frame has no debug info."); - result.SetStatus (eReturnStatusFailed); - break; - } - else + FileSpec file; + if (m_options.m_filename.empty()) { - const SymbolContext &context = cur_frame->GetSymbolContext(true); - if (context.line_entry.file) + StackFrame *cur_frame = m_interpreter.GetDebugger().GetExecutionContext().frame; + if (cur_frame == NULL) { - file = context.line_entry.file; - } - else if (context.comp_unit != NULL) - { file = context.comp_unit; + result.AppendError ("Attempting to set breakpoint by line number alone with no selected frame."); + result.SetStatus (eReturnStatusFailed); + break; } - else + else if (!cur_frame->HasDebugInformation()) { - result.AppendError ("Attempting to set breakpoint by line number alone but can't find the file for the selected frame."); + result.AppendError ("Attempting to set breakpoint by line number alone but selected frame has no debug info."); result.SetStatus (eReturnStatusFailed); break; } + else + { + const SymbolContext &context = cur_frame->GetSymbolContext(true); + if (context.line_entry.file) + { + file = context.line_entry.file; + } + else if (context.comp_unit != NULL) + { file = context.comp_unit; + } + else + { + result.AppendError ("Attempting to set breakpoint by line number alone but can't find the file for the selected frame."); + result.SetStatus (eReturnStatusFailed); + break; + } + } + } + else + { + file.SetFile(m_options.m_filename.c_str()); } - } - else - { - file.SetFile(m_options.m_filename.c_str()); - } - if (use_module) - { - for (int i = 0; i < num_modules; ++i) + if (use_module) { - module.SetFile(m_options.m_modules[i].c_str()); - bp = target->CreateBreakpoint (&module, - file, - m_options.m_line_num, - m_options.m_ignore_inlines).get(); - if (bp) - { - StreamString &output_stream = result.GetOutputStream(); - output_stream.Printf ("Breakpoint created: "); - bp->GetDescription(&output_stream, lldb::eDescriptionLevelBrief); - output_stream.EOL(); - result.SetStatus (eReturnStatusSuccessFinishResult); - } - else + for (int i = 0; i < num_modules; ++i) { - result.AppendErrorWithFormat("Breakpoint creation failed: No breakpoint created in module '%s'.\n", - m_options.m_modules[i].c_str()); - result.SetStatus (eReturnStatusFailed); + module.SetFile(m_options.m_modules[i].c_str()); + bp = target->CreateBreakpoint (&module, + file, + m_options.m_line_num, + m_options.m_ignore_inlines).get(); + if (bp) + { + StreamString &output_stream = result.GetOutputStream(); + output_stream.Printf ("Breakpoint created: "); + bp->GetDescription(&output_stream, lldb::eDescriptionLevelBrief); + output_stream.EOL(); + result.SetStatus (eReturnStatusSuccessFinishResult); + } + else + { + result.AppendErrorWithFormat("Breakpoint creation failed: No breakpoint created in module '%s'.\n", + m_options.m_modules[i].c_str()); + result.SetStatus (eReturnStatusFailed); + } } } + else + bp = target->CreateBreakpoint (NULL, + file, + m_options.m_line_num, + m_options.m_ignore_inlines).get(); } - else - bp = target->CreateBreakpoint (NULL, - file, - m_options.m_line_num, - m_options.m_ignore_inlines).get(); - } - break; + break; + case eSetTypeAddress: // Breakpoint by address bp = target->CreateBreakpoint (m_options.m_load_addr, false).get(); break; -- cgit v1.2.3