Commit Graph

13 Commits

Author SHA1 Message Date
Johnny Chen 758f288cdd Add a Python script to locate each binary file under a root directory which matches some pathname pattern
and to invoke lldb-disasm.py on the binary file to disassemble its symbols.  The number of symbols can
be specified by, for example, '-n 10000', to specify 10,000 symbols to disassemble for each module.
By default, only 1000 symbols from each module are disassembled.

Example:

utils/test/run-dis.py -r '/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3/Symbols' -p '^/System/Library/.*Frameworks/.*\.framework/[^/]+$'

tries to disassemble every public/private frameworks (by default only 1000 symbols are disassembled) under iOS4.3.

llvm-svn: 138078
2011-08-19 20:51:15 +00:00
Johnny Chen 4c35b711da Fix TypeError exception for re.compile().
llvm-svn: 138045
2011-08-19 17:28:25 +00:00
Johnny Chen 293683b6c4 Add an option (-p regexp-pattern) to specify the regular expression symbol pattern we're interested in disassembling.
An example:

utils/test/lldb-disasm.py -C "platform select remote-ios" -o "-b -n" -e '~/CoreFoundation' -n 20 -p '-\[NSArray .+\]'

disassembles the first 20 NSArray instance methods found in the CoreFoundation module.

llvm-svn: 138002
2011-08-18 22:46:50 +00:00
Johnny Chen 901209dcca Add an option '-q' to have quiet disassembly by not printing out the disassembled result.
This could be useful by reducing the strain on standard output.

Example:

utils/test/lldb-disasm.py -C "platform select remote-ios" -o "-b -n" -e '~/CoreFoundation' -n 50 -q

llvm-svn: 137988
2011-08-18 22:04:27 +00:00
Johnny Chen 26fc16b032 Use built-in truth value testing.
llvm-svn: 132078
2011-05-25 20:47:27 +00:00
Johnny Chen b5aa97ecc5 Add a Python utility to help convert the Mail.app saved 'Raw Message Source' .eml file to a git-am friendly file.
llvm-svn: 131924
2011-05-23 21:50:12 +00:00
Johnny Chen 6cd4d1d85a Modified to take advantage of the iteration protocol for our lldb container objects.
llvm-svn: 130457
2011-04-28 23:34:58 +00:00
Johnny Chen d16c105c3d Take advantage of the newly added SBSymbol.GetType() API to check whether we
have a Code symbol and do disassembly on it.

llvm-svn: 128604
2011-03-31 01:34:55 +00:00
Johnny Chen 0e43f321b6 Add a generator to iterate through the code symbols for a given target.
To be modified to take advantage of the new SBSymbol API which checks a symbol for its type.

llvm-svn: 128601
2011-03-31 01:06:28 +00:00
Johnny Chen 318e7ba65d Add an option to specify the symbols to disassemble instead of the existing 'num of symbols to disassemble'
option.  If both are present, the 'symbols to disassemble' overrides the 'num of symbols to disassemble'.

An example usage:

$ ./lldb-disasm.py -C 'platform create remote-ios' -e /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/libSystem.B.dylib -o '-r -n' -s vprintf -s acosf_special

llvm-svn: 128569
2011-03-30 18:47:54 +00:00
Johnny Chen 6454e15f49 Add the ability to invoke lldb's disassemble command on the symbols digested from
the 'image dump symtab' command.  The number of symbols to disassemble can be
specified by the '-n Num' option, or unlimited if not specified.

llvm-svn: 128442
2011-03-29 01:07:00 +00:00
Johnny Chen 4044fdccfc Doc string change.
llvm-svn: 128429
2011-03-28 22:48:25 +00:00
Johnny Chen 5e28aa5d9b Add an initial version of lldb-disasm.py script whose purpose is to iterate through
all the symbols for an executable image and to issue the lldb 'disassemble' command
on each symbol.  The initial version just dumps the symbol table.

llvm-svn: 128428
2011-03-28 22:40:32 +00:00