Migrating from Inspect to Native Inspect
Migrating from Inspect to Native Inspect
2 of 15 Hewlett-Packard Company 543427-002
During the development and debugging
phase, compile programs at optimize level 0
(O0).
Tip: Use the enoft lp * d command to
determine the optimization level of the functions
that compose your program.
Starting Programs
You start programs under control of the
debugger the same way as on earlier
systems.
Guardian: use the rund command.
OSS: use the –debug command-line
option
GDB Difference: GDB users commonly launch
their programs from within the debugger, which
has the benefit of breakpoints persisting across
debugging sessions. Native Inspect does not
support this capability at this time.
Debugger Selection Rules
The rules for selecting which debugger a
process is delivered to have changed
slightly:
Processes are delivered to Visual Inspect
if you have established a client
connection with a matching user ID and
either:
o The process’ INSPECT ON
attribute is set.
o The process is a TNS process.
Otherwise:
o TNS/E processes are delivered to
Native Inspect.
o TNS processes are delivered to
Inspect.
Note: If the Inspect subsystem ($IMON and
$DMxx) is not running, TNS processes are
delivered to Native Inspect, but available
debugging operations are limited to: tracing the
stack, stopping the process, creating a snapshot
file, or switching to Inspect once the Inspect
subsystem is started.
Debugging Running Processes
From a TACL prompt, use the DEBUG or
DEBUGNOW commands to force a program
under debugger control.
Note: The same NonStop security rules are used
to determine when the process can be delivered
to the debugger, and the previously described
debugger selection rules are applied.
Specify the TERM option to start the
debugger on your current terminal rather
than on the home terminal for the process.
From within Native Inspect, use the attach
command to obtain control of a running
process. For example, attach 235.
Inspect Difference: Native Inspect must run in
the same CPU as the processes it is debugging.
Multiprocess Debugging
In Inspect, you could debug multiple
processes with a single debugging session;
however, you could only view the state of
one process at a time, and you often had to
use the break key to switch between
processes.
Native Inspect support for multiprocess
debugging is more limited in that all
processes must execute in the same CPU.
Visual Inspect is the best tool for debugging
multiple processes, because it allows you to
view and easily switch among all processes.
Alternatively, you can use several terminal
sessions to run multiple instances of Native
Inspect.
Listing Source
One of the first things you will likely want
to do is list the source text surrounding the
current location in the currently selected
stack frame.
In Native Inspect, use the list command to
list source. The first invocation lists lines
surrounding the current location. The current
location is marked with an asterisk.
Subsequent invocations list following lines.
To list source at a specified location, specify
a line number and optional file name:










