added support for colored output for the commands
- image lookup -r -s <func-regex>
- image lookup -r -n <func-regex>
For option (1) lookupSymbolInModule(CommandObjectTarget.cpp) is called. We first match the regex against the symbol names. Then update the
name(Symbol Demangled name) with colored matches. So that the symbol when displayed down the line(in SymbolContext.DumpStopContext) is printed
with colored text. Once the symbols are displayed, we restore the original symbols names.(Symbol Demangled name)
For option (2) lookupfunctionInModule(CommandObjectTarget.cpp) is called. As the symbol names are accessed in Module.cpp we repeat the
above process in it.
Doesn't seem like you need to enumerate them, so this could be:
(https://en.cppreference.com/w/cpp/language/range-for)
Or std::find(..., <lambda>) != positions.end() but same thing really.
Basically prefer iterators unless i is needed for something other than indexing.
If you do need the index but don't want the hassle of handling it yourself, there is an llvm::enumerate in llvm/include/llvm/ADT/STLExtras.h which acts like Python's enumerate.