Debug Manual

Table Of Contents
Debug Command Overview
Debug Manual421921-003
3-14
Address Syntax
N-mode
Indicates that the user is in a 32-bit address mode.
Considerations
If you omit address-mode and if offset is a 16-bit word expression, Debug
assumes one of two address modes depending on where address appears. If
address appears in a B, C, or I command, omitting address-mode causes
Debug to use a C-relative code address in the current TNS code segment (same
as C address-mode).
°
If address appears in a D, A, FN, or M command, omitting address-mode
causes Debug to use a G-relative address in the TNS user data segment.
If you omit address-mode and if offset is a 32-bit expression, Debug assumes
extended addressing.
To indicate an address in a flat segment, use N-mode address and specify a 32-bit
RISC address in the flat segment range as returned by the ALLOCATESEGMENT
or SEGMENT_ALLOCATE_ procedure call.
When using UC and UD as a default, the user needs to take the following into
consideration:
°
If the command deals with code, UC is assumed as the default.
°
If the command deals with data, UD is assumed as the default.
Direct addressing versus indirect addressing
There are two basic forms of the display command: the direct form and the indirect
form. The direct form is used to display direct variables, value parameters,
contents of pointers, and the addresses in reference parameters. The indirect form
is used to display indirect variables (arrays), objects of pointers, and the values of
reference parameters.
Using the Direct Form
In the following example, the programmer wants to display the contents of some
global variables. The first action is to refer to the map of global identifiers located at
the end of the compiler listing:
DB^BUF VARIABLE INT G+010 INDIRECT
DB^COUNTREAD VARIABLE INT G+011 DIRECT
DB^ERRCNT VARIABLE INT G+007 DIRECT
N Use N mode to indicate addresses in native or accelerated code, RISC
stacks, native globals and heap areas, flat segments or the currently in-use
selectable segment, or anywhere 32-bit addressing is convenient.
In nonprivileged mode, you can specify addresses in user space, 0 through
0x7FFFFFFF. (Not all of these addresses are valid in any process
environment, and some ranges are reserved for privileged access.)
In privileged mode, you can specify all available addresses.