CRE Programmer's Guide
CRE Services
Common Run-Time Environment (CRE) Programmer’s Guide—528146-004
2-66
Circumventing the CRE
Using Visual Inspect
In Program Control View, choose Breakpoints from the View menu. In the Breakpoints
Manager window, choose the Data tab and click the + tool button. From the Add
Breakpoint window, select the Address radio button and enter %0 in the Address box.
Then click OK.
Circumventing the CRE
All HP languages support syntax that you can use to circumvent the CRE or to
circumvent your languages’ run-time libraries by calling system procedures directly.
Although some situations might require that you call system procedures directly, do so
Example 2-3. Inspect Session for C Program That Overwrites the MCB Pointer
mysubv 46> rund mtro <-- Run with Inspect.
INSPECT - Symbolic Debugger - T9673D10 - (08JUN92) System \ASYS
Copyright HP Computers Incorporated 1983, 1985-1992
INSPECT
175,03,00147 MTRO #_MAIN.#10.001(MTR)
-MTRO-b #main <-- Set breakpoint
Breakpoint created: 1 Code #main.#4(MTR) at start user code.
-MTRO-resume <-- Resume execution.
PID: 3,147 \ASYS.$FACE.MYSUBV.MTRO
INSPECT BREAKPOINT 1: #main
175,03,00147 MTRO #main.#4(MTR)
-MTRO-source on <-- Display source code
SOURCE mode has been enabled when program reaches
-MTRO-source breakpoint.
#1 #pragma runnable
#2 #pragma symbols
#3 main ()
1 *#4 { <-- Asterisk means
#5 int *i; statement 4 (actually
#6 i = 0; statement 6) is the
#7 *i = 0100; next statement to
#8 *i = 0101; execute.
#9 *i = 0102;
#10 }
-MTRO-low <-- Use low-level Inspect.
_MTRO_bm 0,w <-- Set memory breakpoint
_MTRO_high <-- Use high-level Inspect
-MTRO-resume <-- Resume execution
INSPECT MEMORY ACCESS BREAKPOINT <-- Breakpoint hit
175,03,00147 MTRO #main.#8(MTR) <-- Inspect shows line
*#8 *i = 0101;
-MTRO-source <-- Display full text
1 #4 { showing asterisk on
#5 int *i; statement 8, which
#6 i = 0; shows that the error
#7 *i = 0100; occurred at
*#8 *i = 0101; statement 7.
#9 *i = 0102;
#10 }
-MTRO-low <-- Use low-level Inspect
_MTRO_d 0 <-- Value at location 0 is
000000: 000100 <-- 100 octal, which was
_MTRO_stop <-- stored at statement 7.
mysubv 47>