Native Inspect Manual (H06.03+)
Table Of Contents
- What’s New in This Manual
- About This Manual
- 1 Introducing Native Inspect
- Native Inspect on TNS/E Systems
- Debuggers on NonStop TNS/E Systems
- Origins of Native Inspect
- Process Debugging With Native Inspect
- Debugging Multiple Processes
- Global Debugging
- Debugging TNS Processes
- Snapshot File Analysis
- Debugging DLLs
- Handling Events
- Switching Debuggers (To or From Inspect and Visual Inspect)
- Stopping Native Inspect
- Differences Between Native Inspect and WDB and GDB
- 2 Using Native Inspect
- Quick Start for Inspect Users
- Preparing to Debug Using Native Inspect
- Sample Native Inspect Session
- Start Your Program Under Native Inspect
- Load Symbols
- Determine Compilation-Time Source Name
- Set Source Name Mapping
- Add Current Directory to Source Search Path
- List Source
- Set a Breakpoint on main()
- Continue Execution
- Trace the Stack (Back Trace)
- List Source
- Step Execution (Over Any Function Calls)
- Print a Variable
- Step Execution (Over Any Function Calls)
- Step In to a Called Function
- Set a Memory Access Breakpoint (MAB)
- Trace the Stack (Back Trace)
- List Source
- Continue Listing Source
- Set a Breakpoint on Line 52
- Continue Execution
- Display a Structure
- Enable “pretty” Printing
- Modify a Structure Field
- Terminate Program and Session
- 3 Syntax of Native Inspect Commands
- Categories of Native Inspect Commands
- Syntax of Common Command Elements
- # command
- a command
- add-symbol-file command
- amap command
- attach command
- base command
- break command, tbreak command
- bt command
- can command
- cd command
- commands command
- comment command
- condition command
- continue command
- d command
- delete command
- delete display command
- detach command
- dir command
- disable command
- disable display command
- disassemble command, da command
- display command
- dmab command
- down command, down-silently command
- enable command
- enable display command
- env command
- eq command
- exit command
- fc command
- files command
- finish command
- fn command
- frame command, select-frame command
- help command, help option
- hold command
- i command
- ignore command
- ih command
- info command
- jb command
- jump command
- kill command
- list command
- log command
- ls command
- mab command
- map-source-name command
- mh command
- modify command
- next command, nexti command
- nocstm option
- output command
- print command
- priv command
- ptype command
- pwd command
- quit command
- reg command
- save command
- select-frame command
- set command (environment)
- set command (variable)
- show command
- snapshot command
- source command
- step command, stepi command
- switch command
- symbol command, symbol-file command
- tbreak command
- tj command, tu command
- tn command
- unload-symbol-file command
- until command
- up command, up-silently command
- vector command
- version option
- vq command
- wait command
- whatis command
- x command
- 4 Using Tcl Scripting
- A Command Mapping With Debug and Inspect
- Glossary
- Index

Using Tcl Scripting
Native Inspect Manual—528122-003
4-6
Tcl Examples
To create and use a simple Tcl command (allbases):
To use a Tcl command (ListPCBs) to walk data structure (symexpr is a Tcl
command used to evaluate symbolic expressions):
file: mytcl
#------------------------------------------------------------------
# Syntax: allbases <expr>
# Effect: Evaluate the expression and display the result in different
# formats.
#------------------------------------------------------------------
proc allbases { args } {
# sanity check
if { ! [llength args] } {
SYNTAX_ERROR eq
}
set result [matheval $args]
set char [ASCII $result]
PUT "\n"
PUT "OCT: [format %06o $result] DEC: [format %-5d $result] HEX:
0x[format
%04x $result] ASCII: \'$char\'\n"
}
(eInspect 3,615):tcl source mytcl
(eInspect 3,615):allbases 304
OCT: 000460 DEC: 304 HEX: 0x0130 ASCII: '...0'
(eInspect 3,615):
#------------------------------------------------------------------
# Syntax: ListPCBS
# Synopsis: Walk the PCBList, printing info about each PCB
#------------------------------------------------------------------
proc ListPCBs { } {
set pcbCount [FORMAT [SYMEXPR PCBList.count] short DEC]
PUT "\n$pcbCount Active PCBs\n"
PUT "pin\tflags\tattributes\n"
for { set i 0 } { [expr $i < $pcbCount] } { incr i } {
set pin [SYMEXPR PCBList.entry\[$i\]->ref.pcb->pin]
set flags [SYMEXPR PCBList.entry\[$i\]->ref.pcb->flags.word]
set attributeCount [SYMEXPR PCBList.entry\[$i\]->ref.pcb-
>attributeCount]
PUT "[FORMAT $pin short DEC]\t[FORMAT $flags short]\t[FORMAT
$attributeCount short DEC]\n"
}
}










