disassembling code on system V
Mike Stroyan
stroyan at hpfcdc.HP.COM
Sun Feb 14 10:32:37 AEST 1988
>I want to disassemble some library code on a Sys V.2 system to get an idea how
>it executes. But how do I just say:
>
> disassemble from Address A to Address B, and if you understand the symbols,
>print them out too.
>
>Any magic sequence of commands in adb or sdb? Or try something else?
You can disassemble with adb by typing "<symbol>?i" or "<address>?i".
It will take an instruction count before "i", but I don't know any way
to specify an address range rather than a number of instructions. A
simple way to use this as a disassembler is to make a command file
containing "0?i" followed by a few thousand blank lines, then executing
"adb a.out < command_file > backlist". The many blank lines will repeat
the single "?i" command, which works better than a large count because
it labels every instruction with a symbolic address. This approach will
try to interpret everything as instructions, so data areas may look like
strange code, and real code after data may take a few instructions to
'sync up'.
Mike Stroyan, [hplabs!]hpfcla!stroyan
More information about the Comp.unix.questions
mailing list