[Lldb-commits] [lldb] r174695 - Added the ability to specify a breakpoint using the GDB '*ADDRESS' format:

Greg Clayton gclayton at apple.com
Thu Feb 7 18:54:24 PST 2013


Author: gclayton
Date: Thu Feb  7 20:54:24 2013
New Revision: 174695

URL: http://llvm.org/viewvc/llvm-project?rev=174695&view=rev
Log:
Added the ability to specify a breakpoint using the GDB '*ADDRESS' format:

(lldb) b *0x1234

You can still of course just specify an address:

(lldb) b 0x1234

Also now we accept the '&' before function names to indicate to not to skip the function prologue like GDB supports. To see how this works:

(lldb) settings set interpreter.expand-regex-aliases 1
(lldb) b &main
breakpoint set --name 'main' --skip-prologue=0
Breakpoint 1: where = a.out`main at main.c:20, address = 0x0000000100000b60
(lldb) b main
breakpoint set --name 'main'
Breakpoint 2: where = a.out`main + 54 at main.c:21, address = 0x0000000100000b96



Modified:
    lldb/trunk/source/Interpreter/CommandInterpreter.cpp

Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=174695&r1=174694&r2=174695&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Thu Feb  7 20:54:24 2013
@@ -395,10 +395,11 @@ CommandInterpreter::LoadCommandDictionar
 
     const char *break_regexes[][2] = {{"^(.*[^[:space:]])[[:space:]]*:[[:space:]]*([[:digit:]]+)[[:space:]]*$", "breakpoint set --file '%1' --line %2"},
                                       {"^([[:digit:]]+)[[:space:]]*$", "breakpoint set --line %1"},
-                                      {"^(0x[[:xdigit:]]+)[[:space:]]*$", "breakpoint set --address %1"},
+                                      {"^\\*?(0x[[:xdigit:]]+)[[:space:]]*$", "breakpoint set --address %1"},
                                       {"^[\"']?([-+]?\\[.*\\])[\"']?[[:space:]]*$", "breakpoint set --name '%1'"},
                                       {"^(-.*)$", "breakpoint set %1"},
                                       {"^(.*[^[:space:]])`(.*[^[:space:]])[[:space:]]*$", "breakpoint set --name '%2' --shlib '%1'"},
+                                      {"^\\&(.*[^[:space:]])[[:space:]]*$", "breakpoint set --name '%1' --skip-prologue=0"},
                                       {"^(.*[^[:space:]])[[:space:]]*$", "breakpoint set --name '%1'"}};
     
     size_t num_regexes = sizeof break_regexes/sizeof(char *[2]);





More information about the lldb-commits mailing list