[Lldb-commits] [PATCH] D136462: [LLDB] Add color to output text when searching for symbols

Varun Kumar E via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 21 09:06:30 PDT 2022


varunkumare99 created this revision.
varunkumare99 added a reviewer: DavidSpickett.
Herald added a project: All.
varunkumare99 requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

added support for colored output for the commands

1. image lookup -r -s <func-regex>
2. 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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136462

Files:
  lldb/include/lldb/Core/Module.h
  lldb/include/lldb/Symbol/Symbol.h
  lldb/include/lldb/Symbol/Symtab.h
  lldb/source/Commands/CommandObjectTarget.cpp
  lldb/source/Core/Module.cpp
  lldb/source/Symbol/Symbol.cpp
  lldb/source/Symbol/Symtab.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136462.469644.patch
Type: text/x-patch
Size: 18859 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20221021/c7e1807d/attachment-0001.bin>


More information about the lldb-commits mailing list