HPlogo System Debug Reference Manual > Chapter 10 System Debug Standard Functions

func cmbpindex

MPE documents

Complete PDF
Table of Contents
Index

E0201 Edition 4 ♥
E0300 Edition 3
E0692 Edition 3

Returns the CM breakpoint index associated with the indicated CM code address.

Syntax



   cmbpindex (cmaddr [pin])

This function accepts the address (either logical or absolute) of an existing CM breakpoint and returns the logical index number associated with that breakpoint. The default action is to look for breakpoints set by the current PIN. Breakpoint indices for other PINs (including the global PIN) may be retrieved by utilizing the optional pin parameter.

Formal Declaration


cmbpindex:u16 (cmaddr:cptr [pin:s16=0])

Parameters


cmaddr

Look for this address in the CM breakpoint table. Both logical and absolute code addresses are supported.

pin

Look for breakpoints set by this PIN. Default is the caller's PIN (a pin of 0 implies this). To specify system (global) breakpoints, use a -1 (or 32762) as the PIN.

Examples



   %cmdebug > bl
   CM      [1] PROG % 2.3401    TEST'SCREEN+%26
   CM      [2] PROG % 0.347     TEST'FILES+%0
   CM     @[1] SYS  % 161.5274  FOPEN+%0

First, list the existing breakpoints.

  %cmdebug > wl cmbpindex(TEST'FILES)
  %2

Go find the CM breakpoint index associated with the address TEST'FILES.

   %cmdebug > wl cmbpindex(FOPEN)
   No breakpoint exists in the breakpoint tables with that address.
   (error #1080)

   Error evaluating a predefined function.  (error #4240)
     function is"cmbpindex"
wl cmbpindex(FOPEN)
Now, go find the breakpoint index for the breakpoint at FOPEN. In this example we get an error. This is because we did not specify a PIN and thus searched only for process local breakpoints. We do not have a process local breakpoint at FOPEN.

   %cmdebug > wl cmbpindex(FOPEN, -1)
   %1

Go find the breakpoint index for the breakpoint at FOPEN. This time we specify a -1 to tell the function to search the list of system breakpoints.

Limitations, Restrictions


none




func cmbpaddr


func cmbpinstr