diff options
author | Greg Clayton <gclayton@apple.com> | 2012-08-29 21:13:06 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-08-29 21:13:06 +0000 |
commit | 1f7460716bcb2a0919124da96365e7deb4b4181e (patch) | |
tree | ba67de6446b4d9d1107b2a2739ddfa68f7607fb2 /lldb/source/Commands | |
parent | 23793141a1ea05f443541f580ad061225fa47052 (diff) | |
download | bcm5719-llvm-1f7460716bcb2a0919124da96365e7deb4b4181e.tar.gz bcm5719-llvm-1f7460716bcb2a0919124da96365e7deb4b4181e.zip |
<rdar://problem/11757916>
Make breakpoint setting by file and line much more efficient by only looking for inlined breakpoint locations if we are setting a breakpoint in anything but a source implementation file. Implementing this complex for a many reasons. Turns out that parsing compile units lazily had some issues with respect to how we need to do things with DWARF in .o files. So the fixes in the checkin for this makes these changes:
- Add a new setting called "target.inline-breakpoint-strategy" which can be set to "never", "always", or "headers". "never" will never try and set any inlined breakpoints (fastest). "always" always looks for inlined breakpoint locations (slowest, but most accurate). "headers", which is the default setting, will only look for inlined breakpoint locations if the breakpoint is set in what are consudered to be header files, which is realy defined as "not in an implementation source file".
- modify the breakpoint setting by file and line to check the current "target.inline-breakpoint-strategy" setting and act accordingly
- Modify compile units to be able to get their language and other info lazily. This allows us to create compile units from the debug map and not have to fill all of the details in, and then lazily discover this information as we go on debuggging. This is needed to avoid parsing all .o files when setting breakpoints in implementation only files (no inlines). Otherwise we would need to parse the .o file, the object file (mach-o in our case) and the symbol file (DWARF in the object file) just to see what the compile unit was.
- modify the "SymbolFileDWARFDebugMap" to subclass lldb_private::Module so that the virtual "GetObjectFile()" and "GetSymbolVendor()" functions can be intercepted when the .o file contenst are later lazilly needed. Prior to this fix, when we first instantiated the "SymbolFileDWARFDebugMap" class, we would also make modules, object files and symbol files for every .o file in the debug map because we needed to fix up the sections in the .o files with information that is in the executable debug map. Now we lazily do this in the DebugMapModule::GetObjectFile()
Cleaned up header includes a bit as well.
llvm-svn: 162860
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r-- | lldb/source/Commands/CommandCompletions.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectArgs.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpoint.cpp | 18 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectDisassemble.cpp | 7 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectDisassemble.h | 1 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectMemory.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectPlatform.cpp | 1 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectProcess.cpp | 1 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectSource.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectTarget.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectThread.cpp | 12 |
11 files changed, 35 insertions, 19 deletions
diff --git a/lldb/source/Commands/CommandCompletions.cpp b/lldb/source/Commands/CommandCompletions.cpp index adeebe311e5..ab782d6bfd0 100644 --- a/lldb/source/Commands/CommandCompletions.cpp +++ b/lldb/source/Commands/CommandCompletions.cpp @@ -21,9 +21,11 @@ #include "lldb/Host/FileSpec.h" #include "lldb/Core/FileSpecList.h" #include "lldb/Core/PluginManager.h" +#include "lldb/Core/Module.h" #include "lldb/Interpreter/Args.h" #include "lldb/Interpreter/CommandCompletions.h" #include "lldb/Interpreter/CommandInterpreter.h" +#include "lldb/Symbol/CompileUnit.h" #include "lldb/Target/Target.h" #include "lldb/Utility/CleanUp.h" diff --git a/lldb/source/Commands/CommandObjectArgs.cpp b/lldb/source/Commands/CommandObjectArgs.cpp index f9d6d02fa02..da5496123b1 100644 --- a/lldb/source/Commands/CommandObjectArgs.cpp +++ b/lldb/source/Commands/CommandObjectArgs.cpp @@ -14,13 +14,14 @@ // Other libraries and framework includes // Project includes #include "lldb/Interpreter/Args.h" +#include "lldb/Core/Debugger.h" +#include "lldb/Core/Module.h" #include "lldb/Core/Value.h" #include "lldb/Expression/ClangExpression.h" #include "lldb/Expression/ClangExpressionVariable.h" #include "lldb/Expression/ClangFunction.h" #include "lldb/Host/Host.h" #include "lldb/Interpreter/CommandInterpreter.h" -#include "lldb/Core/Debugger.h" #include "lldb/Interpreter/CommandReturnObject.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/Variable.h" diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index 6228333cdd6..95d533da5f5 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -91,7 +91,6 @@ public: m_filenames (), m_line_num (0), m_column (0), - m_check_inlines (true), m_func_names (), m_func_name_type_mask (eFunctionNameTypeNone), m_func_regexp (), @@ -104,7 +103,7 @@ public: m_thread_name(), m_queue_name(), m_catch_bp (false), - m_throw_bp (false), + m_throw_bp (true), m_language (eLanguageTypeUnknown), m_skip_prologue (eLazyBoolCalculate) { @@ -285,18 +284,19 @@ public: m_line_num = 0; m_column = 0; m_func_names.clear(); - m_func_name_type_mask = 0; + m_func_name_type_mask = eFunctionNameTypeNone; m_func_regexp.clear(); - m_load_addr = LLDB_INVALID_ADDRESS; + m_source_text_regexp.clear(); m_modules.Clear(); + m_load_addr = LLDB_INVALID_ADDRESS; m_ignore_count = 0; m_thread_id = LLDB_INVALID_THREAD_ID; m_thread_index = UINT32_MAX; m_thread_name.clear(); m_queue_name.clear(); - m_language = eLanguageTypeUnknown; m_catch_bp = false; m_throw_bp = true; + m_language = eLanguageTypeUnknown; m_skip_prologue = eLazyBoolCalculate; } @@ -316,7 +316,6 @@ public: FileSpecList m_filenames; uint32_t m_line_num; uint32_t m_column; - bool m_check_inlines; std::vector<std::string> m_func_names; uint32_t m_func_name_type_mask; std::string m_func_regexp; @@ -398,11 +397,14 @@ protected: } else file = m_options.m_filenames.GetFileSpecAtIndex(0); - + + // Only check for inline functions if + LazyBool check_inlines = eLazyBoolCalculate; + bp = target->CreateBreakpoint (&(m_options.m_modules), file, m_options.m_line_num, - m_options.m_check_inlines, + check_inlines, m_options.m_skip_prologue, internal).get(); } diff --git a/lldb/source/Commands/CommandObjectDisassemble.cpp b/lldb/source/Commands/CommandObjectDisassemble.cpp index 5247743f6ad..38cfe322ddc 100644 --- a/lldb/source/Commands/CommandObjectDisassemble.cpp +++ b/lldb/source/Commands/CommandObjectDisassemble.cpp @@ -14,16 +14,17 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/AddressRange.h" +#include "lldb/Core/Disassembler.h" +#include "lldb/Core/SourceManager.h" #include "lldb/Interpreter/Args.h" #include "lldb/Interpreter/CommandCompletions.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" -#include "lldb/Core/Disassembler.h" #include "lldb/Interpreter/Options.h" -#include "lldb/Core/SourceManager.h" -#include "lldb/Target/StackFrame.h" +#include "lldb/Symbol/Function.h" #include "lldb/Symbol/Symbol.h" #include "lldb/Target/Process.h" +#include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" #define DEFAULT_DISASM_BYTE_SIZE 32 diff --git a/lldb/source/Commands/CommandObjectDisassemble.h b/lldb/source/Commands/CommandObjectDisassemble.h index e99edaccd5d..7587c0a97ca 100644 --- a/lldb/source/Commands/CommandObjectDisassemble.h +++ b/lldb/source/Commands/CommandObjectDisassemble.h @@ -14,6 +14,7 @@ // C++ Includes // Other libraries and framework includes // Project includes +#include "lldb/Core/ArchSpec.h" #include "lldb/Interpreter/CommandObject.h" #include "lldb/Interpreter/Options.h" diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp index 0874f01cf8c..ef1709f120b 100644 --- a/lldb/source/Commands/CommandObjectMemory.cpp +++ b/lldb/source/Commands/CommandObjectMemory.cpp @@ -16,6 +16,7 @@ #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Debugger.h" +#include "lldb/Core/Module.h" #include "lldb/Core/StreamString.h" #include "lldb/Core/ValueObjectMemory.h" #include "lldb/Interpreter/Args.h" @@ -26,7 +27,7 @@ #include "lldb/Interpreter/OptionGroupOutputFile.h" #include "lldb/Interpreter/OptionGroupValueObjectDisplay.h" #include "lldb/Interpreter/OptionValueString.h" -#include "lldb/Symbol/ClangNamespaceDecl.h" +#include "lldb/Symbol/TypeList.h" #include "lldb/Target/Process.h" #include "lldb/Target/StackFrame.h" diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp index 82de22a2cfb..64c05afc062 100644 --- a/lldb/source/Commands/CommandObjectPlatform.cpp +++ b/lldb/source/Commands/CommandObjectPlatform.cpp @@ -15,6 +15,7 @@ // Project includes #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Debugger.h" +#include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" #include "lldb/Interpreter/Args.h" #include "lldb/Interpreter/CommandInterpreter.h" diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index c6b059aa0e6..e744b58dc5b 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -17,6 +17,7 @@ #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Breakpoint/BreakpointSite.h" #include "lldb/Core/State.h" +#include "lldb/Core/Module.h" #include "lldb/Host/Host.h" #include "lldb/Interpreter/Args.h" #include "lldb/Interpreter/Options.h" diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp index ec58e94d445..c4ccf2a2167 100644 --- a/lldb/source/Commands/CommandObjectSource.cpp +++ b/lldb/source/Commands/CommandObjectSource.cpp @@ -16,10 +16,13 @@ #include "lldb/Interpreter/Args.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/FileLineResolver.h" +#include "lldb/Core/ModuleSpec.h" #include "lldb/Core/SourceManager.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" #include "lldb/Host/FileSpec.h" +#include "lldb/Symbol/CompileUnit.h" +#include "lldb/Symbol/Function.h" #include "lldb/Target/Process.h" #include "lldb/Target/TargetList.h" #include "lldb/Interpreter/CommandCompletions.h" diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index cc83190cd49..15523b31f2e 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -18,6 +18,8 @@ #include "lldb/Interpreter/Args.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/InputReader.h" +#include "lldb/Core/Module.h" +#include "lldb/Core/ModuleSpec.h" #include "lldb/Core/Section.h" #include "lldb/Core/State.h" #include "lldb/Core/Timer.h" @@ -34,6 +36,7 @@ #include "lldb/Interpreter/OptionGroupUInt64.h" #include "lldb/Interpreter/OptionGroupUUID.h" #include "lldb/Interpreter/OptionGroupValueObjectDisplay.h" +#include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/FuncUnwinders.h" #include "lldb/Symbol/LineTable.h" #include "lldb/Symbol/ObjectFile.h" diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index f8deebc9ee1..7cb8273cf39 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -13,15 +13,16 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Interpreter/Options.h" #include "lldb/Core/State.h" #include "lldb/Core/SourceManager.h" - #include "lldb/Host/Host.h" - #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" - +#include "lldb/Interpreter/Options.h" +#include "lldb/Symbol/CompileUnit.h" +#include "lldb/Symbol/Function.h" +#include "lldb/Symbol/LineTable.h" +#include "lldb/Symbol/LineEntry.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Target.h" @@ -31,8 +32,7 @@ #include "lldb/Target/ThreadPlanStepOut.h" #include "lldb/Target/ThreadPlanStepRange.h" #include "lldb/Target/ThreadPlanStepInRange.h" -#include "lldb/Symbol/LineTable.h" -#include "lldb/Symbol/LineEntry.h" + using namespace lldb; using namespace lldb_private; |