Displaying information

szadb provides many ways to display information about the state of your program. Some of these requests were detailed above. Another is $r, which will show the contents of all registers and status flags. If you are interested in an individual register then use something like
<a0=X
Replacing above = with /, or ?, will bring a hexadecimal display of the long word stored at the location pointed to by register a0. Careful here, the last form will move the ``dot''. There are many other possible formats. Try, for example, main,20/x and <b,2/s.

The second example uses one of four read-only variables provided by szadb, which are

llowest text address
tlength of the text segment
bstart of the bbs segment
dlength of the data segment
With an exception of l names follow the UNIX convention. They will be particulary handy if you will have a misfortune of debugging executable without a symbol table.

Formats in requests can be combined. Let us try something like follows.

="Text memory dump"2n;main,<b-main%8+1/4x4^rr|rr8cn
and here are initial lines of a resulting display, where ``.'' replaces all non-printable characters.


[]dump.exm


Note that division is denoted by a % character and that 8 divides a difference <b-main and not only main, since all expressions are evaluated in strict left-to-right order.

Let's break down the format modifiers to see what is actually happening

4x print four short words in hex,
4^ backup the ``dot'' by four current fields (short words),
rr|rr print 2 blanks, vertical bar, and 2 more blanks,
8c print 8 characters,
n and a newline.

Displays that are wider then a current screen width (40 or 80) will have lines split automatically.