Path: utzoo!utgpu!water!watmath!clyde!rutgers!gatech!hao!ames!pasteur!ucbvax!hplabs!hpcea!hpfcdc!stroyan From: stroyan@hpfcdc.HP.COM (Mike Stroyan) Newsgroups: comp.unix.questions Subject: Re: disassembling code on system V Message-ID: <5740018@hpfcdc.HP.COM> Date: 14 Feb 88 00:32:37 GMT References: <11764@brl-adm.ARPA> Organization: HP Ft. Collins, Co. Lines: 21 >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 "?i" or "
?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