diff options
author | Greg Clayton <gclayton@apple.com> | 2010-10-11 01:05:37 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2010-10-11 01:05:37 +0000 |
commit | 6eee5aa0671b8aea82930424ac11fceaba809bd3 (patch) | |
tree | b4149d8831211c0bd1672e74bd6d83b6a8169a81 /lldb/source/Commands/CommandObjectBreakpoint.cpp | |
parent | 46747022d292d2d1568eb0b8044030f4aee6a5b6 (diff) | |
download | bcm5719-llvm-6eee5aa0671b8aea82930424ac11fceaba809bd3.tar.gz bcm5719-llvm-6eee5aa0671b8aea82930424ac11fceaba809bd3.zip |
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
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpoint.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpoint.cpp | 115 |
1 files changed, 58 insertions, 57 deletions
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; |