I know that the -s
option searches the symbol table (image dump symtab
) for symbols matching <symbol>
.
However, I don't understand how the -n
option operates. It returns different results from -s
, and if it doesn't search the symbol table for functions/symbols, where does it look for <function-or-symbol>
?
help image lookup
:
-s <symbol> ( --symbol <symbol> )
Lookup a symbol by name in the symbol tables in one or more target modules.
-n <function-or-symbol> ( --name <function-or-symbol> )
Lookup a function or symbol by name in one or more target modules.
The official GDB to LLDB command map reference says that:
This one finds debug symbols:
(lldb) image lookup -r -n <FUNC_REGEX>
This one finds non-debug symbols:
(lldb) image lookup -r -s <FUNC_REGEX>
Provide a list of binaries as arguments to limit the search.
So, image lookup -n
only searches debug symbols, while image lookup -s
searches non-debug symbols.
In lldb, the "symbol table" means the table that the linker and loader use to go from names to callable objects. So -s will NOT consult debug information.
lldb's convention is to use "function" as opposed to "symbol" to mean the representation of a callable object coming from the debug information. So -n will consult both the linker/loader's symbol table information and debug info to match the given name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With