diff options
author | Greg Clayton <gclayton@apple.com> | 2012-08-23 00:22:02 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-08-23 00:22:02 +0000 |
commit | 754a9369db5d566ec4ec14139c3276bddfbe44c8 (patch) | |
tree | bfb8843822afb5a84543873d6ac35a237fd45995 /lldb/source/Interpreter/CommandInterpreter.cpp | |
parent | bf493942b05b4c15aa93aab69c682ff7bdb44b45 (diff) | |
download | bcm5719-llvm-754a9369db5d566ec4ec14139c3276bddfbe44c8.tar.gz bcm5719-llvm-754a9369db5d566ec4ec14139c3276bddfbe44c8.zip |
<rdar://problem/12022079>
Added a new "interpreter" properties to encapsulate any properties for the command interpreter. Right now this contains only "expand-regex-aliases", so you can now enable (disabled by default) the echoing of the command that a regular expression alias expands to:
(lldb) b main
Breakpoint created: 1: name = 'main', locations = 1
Note that the expanded regular expression command wasn't shown by default. You can enable it if you want to:
(lldb) settings set interpreter.expand-regex-aliases true
(lldb) b main
breakpoint set --name 'main'
Breakpoint created: 1: name = 'main', locations = 1
Also enabled auto completion for enumeration option values (OptionValueEnumeration) and for boolean option values (OptionValueBoolean).
Fixed auto completion for settings names when nothing has been type (it should show all settings).
llvm-svn: 162418
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 05384e4a3e5..6ae9793cbd4 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -59,6 +59,19 @@ using namespace lldb; using namespace lldb_private; + +static PropertyDefinition +g_properties[] = +{ + { "expand-regex-aliases", OptionValue::eTypeBoolean, true, false, NULL, NULL, "If true, regular expression alias commands will show the expanded command that will be executed. This can be used to debug new regular expression alias commands." }, + { NULL , OptionValue::eTypeInvalid, true, 0 , NULL, NULL, NULL } +}; + +enum +{ + ePropertyExpandRegexAliases = 0 +}; + ConstString & CommandInterpreter::GetStaticBroadcasterClass () { @@ -73,6 +86,7 @@ CommandInterpreter::CommandInterpreter bool synchronous_execution ) : Broadcaster (&debugger, "lldb.command-interpreter"), + Properties(OptionValuePropertiesSP(new OptionValueProperties(ConstString("interpreter")))), m_debugger (debugger), m_synchronous_execution (synchronous_execution), m_skip_lldbinit_files (false), @@ -89,8 +103,18 @@ CommandInterpreter::CommandInterpreter SetEventName (eBroadcastBitResetPrompt, "reset-prompt"); SetEventName (eBroadcastBitQuitCommandReceived, "quit"); CheckInWithManager (); + m_collection_sp->Initialize (g_properties); } +bool +CommandInterpreter::GetExpandRegexAliases () const +{ + const uint32_t idx = ePropertyExpandRegexAliases; + return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0); +} + + + void CommandInterpreter::Initialize () { |