• Keine Ergebnisse gefunden

The following paragraphs describe the features that have been added to sdb in going from version 3.40b to 4. lOa.

1. Floating point disassembly

sdb now supports disassembly of floating point instructions.

2. New addressing modes for bs command

The bs command, which is used to set or modify a breakpoint, has two new addressing modes, @func and @. @func causes a temporary breakpoint to be set at the return address of the specified function, whenever the function is called. The breakpoint is dynamically set when the function is entered, and is removed once taken; thus, the actual breakpoint address can differ for each call to the specified function.

@ causes a permanent breakpoint to be set at the return address of the current function. The breakpoint must be explicitly removed using the be command.

3. New display information for the lxi command

The bd comnland, which lists breakpoints that have been set with the bs command, has been enhanced to support the bs @/ltlle command. Such a breakpoint can have one or more entries in the breakpoint list. One entry always exists for such a breakpoint: its address field contains the function address, preceded by the @ character. The other entries follow the @ entry, and define actual addresses at which temporary breakpoints will be taken on return from the function; the address field for these entries contains the actual breakpoint address, preceded by the A character.

4. Olanges to the print command

The following paragraphs describe changes that have been made to the print command

4.1 The P command

A 'P' command has been added, which is just like the 'p' command, except it prints the address of the display items.

4.2 FOl'mat override character @ is now optional

The print command can display the same field in several formats.

If you don't specify a format, the field will be displayed in its default format. In previous versions of sdb, you had to precede the characters that defined the override format with a @ character. This preceding

sdb sdb-ap.l v4.10a

SDB Aztec C86

@ is now optional. It is also obsolete, and will be removed in the next version of sdh.

4.3 Changes to the string format specifier, 's'

The's' format has been changed slightly. It now causcs the non-printable characters in a character string to be displayed using standard I

backslash notation. For example, if a character string is defined as follows:

char arr[]=lIabc\ tdef\nll;

then the command lipS arr" prints "abc\ tdef\n".

4.4 Precision specification for strin~

The number of characters to be printed from a character string can be defined by preceding the's' or'S' specifier with a period followed by a number. For example, the command IIp.8s arr" prints the first 8 characters from arr.

4.5 Precision specifier

The precision specifier, a period followed by a number, now applies just to the next string- or float-specifier, and not to subsequent specifiers. For example, if you enter "p.5f flll and then "pf f2", /1 will be displayed using five digits of precision, and /2 using the default 7 digits of precision.

4.6 Repeating a print command

Typing 'p' without operands causes sdh to recompute the address used in the last print command. Typing the return key causes sdh to display the next value in a list of values.

For example, suppose that ip is a pointer to an array of illtS. Then the following command displays the in! pointed at by ip:

p*d ip

If you then type return, sdh will display the second in! in the array.

If you then type 'p' without operands, sdh will display the first in!

again.

5. Olanges to the 't' command

In assembly mode, sdh will now skip over calls, instead of single-stepping into the called function.

6. Suspension of source mode

When sdh is in source mode and enters a fUllction for which no source information exists, it will suspend source mode and enter assembly mode until it gcts back to a function for which source information exists.

v4.10a sdb-ap.2 sdb

Aztec C86

7. Qualifying names and expressions 7.1 Name qualifiers

SDB

Previous version of sdb have only allowed you to access variables that are in the current function and the module that contains it Using name qualifiers, you can now access automatic and static variables that are located in other functions and modules.

There are two types of qualifiers: file qualifiers and function qualifiers. File qualifiers are used to specify the file that contains file-scope statics; i.e. static variables that are defined outside of any function. Function qualifiers are used to access automatic and static variables that are visible to an active function; i.e. to a function that has been called but that hasn't yet returned.

A qualifier to a variable name precedes the name, and is separated defined. The qualifier precedes the parenthesized expression, and is separated from it by a period.

7.3 Disambiguating qualified names and expressions

There are cases where sdb can't tell where the qualifier ends and the qualified name begins. To clearly identify the qualifier from the qualified name, surround the qualifier with backquotes.

sdb sdb-ap.3 v4.10a

SDB Aztec C86 For example,

=

'my-prog.c'.av

8. Searching for unqualified names

If you specify an unqualified name, sdb will first search for it in ~ the current function and module. If not found, it will then look for a file-scope static of that name in the file, if any, that's currently being examined using the df (display file) command.

9. Displaying commen ts

When sdh displays a statement, it will display the comments that immediately precede it. The previous version of sdb displayed the comments that followed a displayed statement.

10. User names and regis ter names

User names take precedence over register names. For example, if your program has a variable named ax, the command "dw ax" will display the contents of that variable, and not of the AX register.

11. Executing another command

While sdh is active, you can execute a DOS command, batch file, or

program named cl1ul by entering: \

!cmd

12. Separate screens for programs and sdb (the -w option)

When used on an IBM PC or an equivalent, sdb can optionally maintain separate screens for itself and for a program that is being debugged. With this feature enabled, a program-generated screen is displayed while a program is executing, and a screen of operator-sdb interactions is displayed while sdb is executing.

By default, this feature is implemented as follows: when a program encounters a breakpoint, sdh saves the contents of the screen and displays the debug screen; similarly, when sdb continues a program, it saves the debug screen and restores the program screen.

Alternatively, if your system has a display adaptor that supports multiple pages, you can tell sdb to display its information on a specified page. This will speed up sdb, since it won't have to save and restore screens.

To enable the use of separate screens for programs and sdb, where sdb will save and restore the sdb and program screens, specify the -lV

option when you start sdb. This option must precede the name of the program that is to be debugged. To have sdb use a specific page of display memory for its display, follow the -lV option with the number

v4.10a sdb-ap.4 sdb

Aztec C86

snB

of the page that is to be used for sdb's information.

Two sdh commands arc related to separate program/debug screens:

* The w command causes sdb to toggle between displaying the de bug and program screen.

* The JV command disables screen saving and restoring.

13. Using two screens (the -2 option)

The -w option described above allows sdb to separate its displayed information from that of a program, using just one actual display. If you have two displays, you can have the program's information displayed on the default display (the one that was active when sdb was started), and sdb's information displayed on the other by specifying the option -2 when you start sdb.

sdb sdb-ap.5 v4.10a

SDB Aztec C86

v4.10a sdb-ap.6 sdb

Aztec C86

snB

Tutorial