diff options
author | Dawn Perchik <dawn@burble.org> | 2015-07-21 22:05:07 +0000 |
---|---|---|
committer | Dawn Perchik <dawn@burble.org> | 2015-07-21 22:05:07 +0000 |
commit | 23b1decbe763783c630763c0ae9b7b20773131c8 (patch) | |
tree | fdd11d22d8a0ab885562f2a07d7aa9720293bc19 /lldb/source/Commands/CommandObjectBreakpoint.cpp | |
parent | f836c89c4953d9ca5e390b41e0ebc84c903a46c0 (diff) | |
download | llvm-23b1decbe763783c630763c0ae9b7b20773131c8.zip llvm-23b1decbe763783c630763c0ae9b7b20773131c8.tar.gz llvm-23b1decbe763783c630763c0ae9b7b20773131c8.tar.bz2 |
Add support for specifying a language to use when parsing breakpoints.
Target and breakpoints options were added:
breakpoint set --language lang --name func
settings set target.language pascal
These specify the Language to use when interpreting the breakpoint's
expression (note: currently only implemented for breakpoints on
identifiers). If the breakpoint language is not set, the target.language
setting is used.
This support is required by Pascal, for example, to set breakpoint at 'ns.foo'
for function 'foo' in namespace 'ns'.
Tests on the language were also added to Module::PrepareForFunctionNameLookup
for efficiency.
Reviewed by: clayborg
Subscribers: jingham, lldb-commits
Differential Revision: http://reviews.llvm.org/D11119
llvm-svn: 242844
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpoint.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpoint.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index 162bfb4..b61a256 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -111,6 +111,7 @@ public: m_throw_bp (true), m_hardware (false), m_exception_language (eLanguageTypeUnknown), + m_language (lldb::eLanguageTypeUnknown), m_skip_prologue (eLazyBoolCalculate), m_one_shot (false), m_all_files (false), @@ -249,6 +250,12 @@ public: break; } + case 'L': + m_language = LanguageRuntime::GetLanguageTypeFromString (option_arg); + if (m_language == eLanguageTypeUnknown) + error.SetErrorStringWithFormat ("Unknown language type: '%s' for breakpoint", option_arg); + break; + case 'm': { bool success; @@ -370,6 +377,7 @@ public: m_throw_bp = true; m_hardware = false; m_exception_language = eLanguageTypeUnknown; + m_language = lldb::eLanguageTypeUnknown; m_skip_prologue = eLazyBoolCalculate; m_one_shot = false; m_use_dummy = false; @@ -411,6 +419,7 @@ public: bool m_throw_bp; bool m_hardware; // Request to use hardware breakpoints lldb::LanguageType m_exception_language; + lldb::LanguageType m_language; LazyBool m_skip_prologue; bool m_one_shot; bool m_use_dummy; @@ -516,6 +525,7 @@ protected: &(m_options.m_filenames), m_options.m_func_names, name_type_mask, + m_options.m_language, m_options.m_skip_prologue, internal, m_options.m_hardware).get(); @@ -709,6 +719,7 @@ private: #define LLDB_OPT_NOT_10 ( LLDB_OPT_SET_FROM_TO(1, 10) & ~LLDB_OPT_SET_10 ) #define LLDB_OPT_SKIP_PROLOGUE ( LLDB_OPT_SET_1 | LLDB_OPT_SET_FROM_TO(3,8) ) #define LLDB_OPT_MOVE_TO_NEAREST_CODE ( LLDB_OPT_SET_1 | LLDB_OPT_SET_9 ) +#define LLDB_OPT_EXPR_LANGUAGE ( LLDB_OPT_SET_FROM_TO(3, 8) & ~LLDB_OPT_SET_7 ) OptionDefinition CommandObjectBreakpointSet::CommandOptions::g_option_table[] = @@ -800,6 +811,9 @@ CommandObjectBreakpointSet::CommandOptions::g_option_table[] = // { LLDB_OPT_SET_10, false, "exception-typename", 'O', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeTypeName, // "The breakpoint will only stop if an exception Object of this type is thrown. Can be repeated multiple times to stop for multiple object types" }, + { LLDB_OPT_EXPR_LANGUAGE, false, "language", 'L', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeLanguage, + "Specifies the Language to use when interpreting the breakpoint's expression (note: currently only implemented for breakpoints identifiers). If not set the target.language setting is used." }, + { LLDB_OPT_SKIP_PROLOGUE, false, "skip-prologue", 'K', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeBoolean, "sKip the prologue if the breakpoint is at the beginning of a function. If not set the target.skip-prologue setting is used." }, |