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

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 17 23:20:56 PST 2022


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 gets updated if the number extraction succeeds. This uses strtoul being the scenes:

  uint32_t StringExtractor::GetU32(uint32_t fail_value, int base);



================
Comment at: lldb/source/Commands/CommandObjectRegexCommand.cpp:13
 
+#include <cmath>
+
----------------
clayborg wrote:
> 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 declarations inside the std namespace for any types that are defined... If we import <math.h> we don't end up with all that. We don't have to change it, but as you are aware dsymutil keeps every type that is defined in these header files because of this extra fluff in the DWARF.
If we end up using strtoul as mentioned below, then:
#include <stdlib.h>


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120101/new/

https://reviews.llvm.org/D120101



More information about the lldb-commits mailing list