[Lldb-commits] [PATCH] find global by regex in SBTarget

jingham at apple.com jingham at apple.com
Fri Sep 19 11:18:51 PDT 2014


I think the enum you added goes in "lldb-enumerations.h" not in SBTarget.h.

Also, I wouldn't use the regex match for the straight match, since that is much less efficient than the ConstString ==, which is just a pointer compare.  In the fullness of time, we would retire the version that doesn't take a MatchType, so we don't want that version to be less efficient.

Also, again, don't forget to add the new definition from SBTarget.h to SBTarget.i or the new API won't be available in Python.

Jim


> On Sep 19, 2014, at 10:59 AM, Carlo Kok <ck at remobjects.com> wrote:
> 
> On Fri, 19 Sep 2014 18:25:54 +0200, <jingham at apple.com> wrote:
> 
>> You can't do it this way, because it changes a public API, which we promised not to do.  You have to add an API instead.  Given that, maybe we want to add an enum to specify the textual match type, analogous to the search type for FindSymbols, so you could do "starts with", "regexp", etc?
>> 
> 
> Sounds like a good idea. The attached patch does this for both GlobalVariables and GlobalFunctions, it supports Regex, "Normal", and StartsWith (all use regex in the end to resolve the variable), I had to add a method in ModuleList as there's nothing ModuleList that does regex, but the underlying per-module apis do support it.
> 
> 
> 
> -- 
> Carlo Kok
> RemObjects Software<find-globals-by-regex2.patch>




More information about the lldb-commits mailing list