Skip to content

Commit 659a383

Browse files
committed
[lldb][Breakpoint] Allow whitespace in breakpoint address expression
Setting a breakpoint on `<symbol> + <offset>` used to work until `2c76e88e9eb284d17cf409851fb01f1d583bb22a`, where this regex was reworked. Now we only accept `<symbol>+ <offset>`. This patch fixes the regression by adding yet another `[[:space:]]*` component to the regex. One could probably simplify the regex (or even replace the regex by just calling the relevent `consumeXXX` APIs on `llvm::StringRef`). Though I left that for the future. rdar://130780342
1 parent e588085 commit 659a383

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lldb/source/Interpreter/OptionArgParser.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,10 @@ OptionArgParser::DoToAddress(const ExecutionContext *exe_ctx, llvm::StringRef s,
262262
// 3: The symbol/reg name if there is an offset
263263
// 4: +/-
264264
// 5: The offset value.
265+
// clang-format off
265266
static RegularExpression g_symbol_plus_offset_regex(
266-
"^(\\$[^ +-]+)|(([^ +-]+)([-\\+])[[:space:]]*(0x[0-9A-Fa-f]+|[0-9]+)[[:space:]]*)$");
267+
"^(\\$[^ +-]+)|(([^ +-]+)[[:space:]]*([-\\+])[[:space:]]*(0x[0-9A-Fa-f]+|[0-9]+)[[:space:]]*)$");
268+
// clang-format on
267269

268270
llvm::SmallVector<llvm::StringRef, 4> matches;
269271
if (g_symbol_plus_offset_regex.Execute(sref, &matches)) {

0 commit comments

Comments
 (0)