Add lldb.find(), a function for interactive lookup and discovery of SB API.
From the lldb console, this function can be used as follows:
(lldb) script lldb.find("register") lldb.SBFrame.FindRegister lldb.SBFrame.GetRegisters lldb.SBFrame.get_registers_access lldb.SBFrame.register lldb.SBFrame.registers (lldb) sc lldb.find("Disassemble") Help on function Disassemble in lldb.SBFrame: lldb.SBFrame.Disassemble = Disassemble(self) -> 'char const *' Disassemble(SBFrame self) -> char const *
In the first case, multiple matches were printed. In the second case, only one
match was found, and so its help() documentation was printed.
The results compose with the builtin help() function:
(lldb) sc help(lldb.SBFrame.FindRegister) ...
If called often enough, a command regex can come in handy:
command regex findapi s/(.+)/script lldb.find("%1")/
Which allows it to be called as findapi register.
oh, I need to figure out the right way to manage imports in this swig extension. It seems that the re module is used (as a default argument) before importing it, and yet this code works.