Added a BSD archive tool.
authorGreg Clayton <gclayton@apple.com>
Mon, 2 Apr 2018 17:20:21 +0000 (17:20 +0000)
committerGreg Clayton <gclayton@apple.com>
Mon, 2 Apr 2018 17:20:21 +0000 (17:20 +0000)
commitde01668b14b45d97f038172aa7b076cc2985c737
tree7a56f9f09e5941ab380410515b3a954d3bafc72b
parentf3db8e3c70491442e2747e2dfa8cc3c07b3b40d1
Added a BSD archive tool.

This is a combination stand alone BSD archive tool that can dump BSD archives:

% bsd.py /path/to/foo.a

Search archives for an object file:

% bsd.py --object foo.o bar.a

Dump the symbol definitions found in the __.SYMDEF objects:

% bsd.py --symdef bar.a

Find symbols by name that are listed in the __.SYMDEF objects:

% bsd.py --symbol _Z123 bar.a

Extract objects from BSD archives:

% bsd.py --object foo.o bar.a --extract
% bsd.py --object foo.o bar.a --extract --outfile /tmp/foo.o
% bsd.py --object foo.o bar.a --extract --mtime 0x1234556

It also has installs a new LLDB command line command when imported into LLDB:

(lldb) command script import ~/Dropbox/bin/bsd.py
The "verify-debug-map-objects" command has been installed, type "help verify-debug-map-objects" for detailed help.
(lldb) verify-debug-map-objects a.out

This will iterate through all object files and verify the modification times match for any .o files, it will verify any .o files from BSD archives are found and have matching modification times and print out errors if any are found.

llvm-svn: 328990
lldb/examples/python/bsd.py [new file with mode: 0755]