[Lldb-commits] [PATCH] D120101: [lldb] Fix (unintentional) recursion in CommandObjectRegexCommand

2022-02-23 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2a6dbedf5a92: [lldb] Fix (unintentional) recursion in CommandObjectRegexCommand (authored by JDevlieghere). Herald added a project: LLDB. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[Lldb-commits] [PATCH] D120101: [lldb] Fix (unintentional) recursion in CommandObjectRegexCommand

2022-02-23 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib accepted this revision. mib added a comment. This revision is now accepted and ready to land. LGTM ! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120101/new/ https://reviews.llvm.org/D120101 ___ lldb-commits mailing list

[Lldb-commits] [PATCH] D120101: [lldb] Fix (unintentional) recursion in CommandObjectRegexCommand

2022-02-21 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 410326. JDevlieghere marked 2 inline comments as done. JDevlieghere added a comment. - Allow using `%0` - Return an error when using an out of range index CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120101/new/

[Lldb-commits] [PATCH] D120101: [lldb] Fix (unintentional) recursion in CommandObjectRegexCommand

2022-02-20 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added inline comments. Comment at: lldb/source/Commands/CommandObjectRegexCommand.h:47 + /// matched with replacements[1] and not replacements[0]. + static std::string SubstituteVariables( + llvm::StringRef input, clayborg wrote: > Do we want a

[Lldb-commits] [PATCH] D120101: [lldb] Fix (unintentional) recursion in CommandObjectRegexCommand

2022-02-20 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added inline comments. Comment at: lldb/source/Commands/CommandObjectRegexCommand.h:47 + /// matched with replacements[1] and not replacements[0]. + static std::string SubstituteVariables( + llvm::StringRef input, Do we want a "Expected" as the

[Lldb-commits] [PATCH] D120101: [lldb] Fix (unintentional) recursion in CommandObjectRegexCommand

2022-02-18 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 409963. JDevlieghere added a comment. Use Pavel's //not-as-cool// solution. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120101/new/ https://reviews.llvm.org/D120101 Files: lldb/source/Commands/CommandObjectRegexCommand.cpp

[Lldb-commits] [PATCH] D120101: [lldb] Fix (unintentional) recursion in CommandObjectRegexCommand

2022-02-18 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. Wouldn't want to miss a good bikeshed. Logarithms are cool, but I think something like this (untested) snippet would be simpler Input.split(Parts, '%'); Result << Parts[0]; for (llvm::StringRef Part : drop_begin(Parts)) { if (!Part.consumeInteger(10, Idx) &&

[Lldb-commits] [PATCH] D120101: [lldb] Fix (unintentional) recursion in CommandObjectRegexCommand

2022-02-17 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. We also have StringExtractor that we could call StringExtractor::GetU32(...) on. We would need to add a new method like: bool StringExtractor::SkipTo(char ch); And then we could call StringExtractor::GetU32(..) if that returns true. The current string position only

[Lldb-commits] [PATCH] D120101: [lldb] Fix (unintentional) recursion in CommandObjectRegexCommand

2022-02-17 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added inline comments. Comment at: lldb/source/Commands/CommandObjectRegexCommand.cpp:13 +#include + I cringe every time I see an old C header being imported as C++ because of the huge amounts of junk it causes the DWARF to incur with many import

[Lldb-commits] [PATCH] D120101: [lldb] Fix (unintentional) recursion in CommandObjectRegexCommand

2022-02-17 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added inline comments. Comment at: lldb/source/Commands/CommandObjectRegexCommand.cpp:38 +// Parse the number following '%'. +const size_t idx = std::atoi(str.c_str() + pos + 1); + mib wrote: > Are we assuming that the number following `%`

[Lldb-commits] [PATCH] D120101: [lldb] Fix (unintentional) recursion in CommandObjectRegexCommand

2022-02-17 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 409824. JDevlieghere marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120101/new/ https://reviews.llvm.org/D120101 Files: lldb/source/Commands/CommandObjectRegexCommand.cpp

[Lldb-commits] [PATCH] D120101: [lldb] Fix (unintentional) recursion in CommandObjectRegexCommand

2022-02-17 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib added inline comments. Comment at: lldb/source/Commands/CommandObjectRegexCommand.cpp:38 +// Parse the number following '%'. +const size_t idx = std::atoi(str.c_str() + pos + 1); + Are we assuming that the number following `%` will always have a

[Lldb-commits] [PATCH] D120101: [lldb] Fix (unintentional) recursion in CommandObjectRegexCommand

2022-02-17 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision. JDevlieghere added reviewers: jingham, clayborg, aprantl, mib. Herald added a subscriber: mgorny. JDevlieghere requested review of this revision. Jim noticed that the regex command is unintentionally recursive: Let's use the following command regex as an