home *** CD-ROM | disk | FTP | other *** search
- [[ Note: This text-only version of the manual was produced by hand from
- the Impression version. It is therefore likely that there are lots of
- infelicities in the formatting; in particular, font changes have been
- lost. If a sentence doesn’t seem to make any sense, see whether it’s
- any better if you pretend some of the words in it are in italics. :-) ]]
-
- User manual for decAOF
- ======================
-
-
- Legal rubbish
- -------------
-
- This program is not public domain; it is mine. The same applies to this
- documentation. You don’t have to pay for it, and you may distribute it
- freely. You may not, however, (1) distribute modified copies, or (2) make
- money from it in any way. You may, of course, modify your own copy. If you
- think your modifications are improvements, get in touch with me and tell me
- more...
-
-
- About this program
- ------------------
-
- This program (called decaof) reads an AOF file (i.e., an object file) and
- displays its contents interactively. It disassembles machine code, and
- inserts labels at addresses corresponding to symbols defined in the file. It
- displays everything in tasteful colours. It is economical in space, and runs
- quickly. It hasn’t crashed my machine for years.
-
-
- Just what is an object file, anyway?
- ------------------------------------
-
- It’s a file containing machine code and data, but with some blanks still to
- be filled in, and with some information on how to fill in the blanks on other
- such files. Typically the blanks are addresses of functions, variables etc.
- It’s rather like an assembly-language program with all the labels still
- there, except that the actual assembly has been done.
-
- Slightly less vaguely: an object file contains
- • a number of areas, each containing code or data or both;
- • a symbol table, giving the names of symbols used or defined in the areas;
- • information on relocations to be done within the areas.
- Relocation is the process of filling in the blanks. The relocation
- instructions say things like “Add the value of symbol so-and-so to the word
- at location such-and-such”.
-
-
- Why do I need your program?
- ---------------------------
-
- The AOF format is slightly hairy, and it’s not much fun staring at a hex dump
- of an object file trying to work out what relocations happen where. Perhaps
- more importantly, it’s very much easier to understand code when you know what
- function is where, and can see at a glance whether that mysterious BL
- instruction is calling printf or delete_all_my_files or solve_equations. And
- it’s useful to be able to move at a moment’s notice to a particular function.
-
-
- How do I use your program? --------------------------
-
- Type decaof <filename>; you will be given some not-very-exciting information
- from the file header, and prompted for what to do next. At this point you
- enter commands and the computer acts on them; there follows a list of
- available commands.
-
- The Address command
-
- Address <address> | <symbol>
- Change the current address to the given location within the current area. If
- you give the address numerically, it should be in hexadecimal; otherwise, you
- may use the name of any symbol in the current area.
-
- The Area command
-
- Area <number> | <name>
- Change the current area to the one specified. Areas are numbered from 1 upwards.
-
- The Areas command
-
- Areas
- Display a list of all the areas in the object file, with their names, sizes
- and numbers of relocations.
-
- The Symbol command
-
- Symbol <prefix>
- Display all the symbols (in all areas, not just the current area) whose names
- begin with the specified prefix, together with their addresses where known.
-
- The Symbols command
-
- Symbols <area> | * | external | absolute
- Display all the symbols in a given area, or all symbols in the entire file,
- or all external symbols, or all absolute symbols.
-
- The Goto command
-
- Goto <address> | <symbol>
- Do the same as the Address command, and then display the rest of the contents
- of the current area until it’s finished or the user presses Escape.
-
- The Page command
-
- Page <address> | <symbol>
- Do the same as the Address command, and then display one screenful of area
- contents.
-
- The Quit command
-
- Quit
- Quit.
-
- The Help command
-
- Help
- Display a list of the available commands.
-
- Calling the operating system
-
- *<command>
- Pass the command to the operating system. Caution: if this loads in a
- program, it may well overwrite the code for decaof, and goodness only knows
- what will happen when it tries to return.
-
-
- Problems
- --------
-
- • It would be nice if it were possible to write all the information decaof
- can produce to a file, for future use. I have a program that does that (an
- earlier version of decaof, in fact), but it doesn’t do all the nice
- interactive things that decaof does.
-
- • decaof displays things in pretty colours. To do this, it assumes that the
- palette is set up as for the desktop. Running it in other circumstances (say,
- immediately after a mode change) may result in its trying to use flashing
- colours and things. Ugh.
-
- • Because white-on-black text is less straining to the eyes than
- black-on-white, decaof changes the background colour. If for some reason you
- depend on having a white background, I suppose this might be a problem. (I
- only mean that it does the equivalent of COLOUR 135; it doesn’t change the
- palette or anything.)
-
- • I think I have observed problems when running decaof together with things
- that intercept OS_ReadLine, such as the LineEditor module. I don’t use that
- myself; if you have problems, let me know and I’ll see what I can do.
-
-
- Feedback
- --------
-
- Here are an e-mail address and a snail-mail address for me. Both are valid as
- of February 1995, and both should work for quite a while yet. I should be
- glad of any comments you have about this program, whether positive or
- negative. Negative comments will be appreciated more if accompanied by
- practical suggestions for improvements.
-
- e-mail: gjm11@pmms.cam.ac.uk
-
- snail-mail: Gareth McCaughan
- Trinity College
- Cambridge CB2 1TQ
- England
-
-