HP 3000 Manuals

func cmproclen [ System Debug Reference Manual ] MPE/iX 5.0 Documentation


System Debug Reference Manual

func cmproclen 

Returns the length of the CM procedure which contains the specified CM
logical code address.

Syntax 

      cmproclen (cmlogaddr)

The procedure length (from procedure start to procedure end) is returned
in CM (16-bit) words.

Formal Declaration 

      cmproclen:u16 (cmlogaddr:lcptr)

Parameters 

 cmlogaddr       The CM logical code address of a procedure whose length
                 is desired.

                 Cmlogaddr must be a full CM logical code address
                 (LCPTR). For example:

                 CMPC                  Current CM program counter
                 CMPW+4                Top of CM program window + 4
                 PROG(2.102)           Program file logical seg 2 offset
                                       102
                 fopen+102             CM procedure fopen + %102 (assumes
                                       CM mode)
                 cmaddr('fopen')+%102  CM procedure fopen + %102 (NM or
                                       CM mode)

Examples 

     %cmdebug > wl cmproclen(cmpc) 
     %843

Print the length of the current CM procedure located at the CM program
counter CMPC.

     %cmdebug > wl cmproclen(fopen) 
     %1642

Print the length of the CM procedure fopen.

Assume that the following single segment CM program has been compiled,
linked with the PMAP and FPMAP options, and is now being executed:

          PROGRAM test (input,output);

          PROCEDURE one;
          begin {one}
            writeln('ONE');
          end;  {one}

          PROCEDURE two;

              PROCEDURE three;
              begin {three}
                writeln('THREE');
              end;  {three}

          begin {two}
            writeln('TWO');
            three;
          end;  {two}

          begin {main body}     { Outer block is named "ob'" by the compiler }
            one;
            two;
          end.  {main body}

        PROGRAM FILE PTEST.DEMO.TELESUP

        SEG'              0
           NAME            STT  CODE ENTRY SEG
           OB'               1     0    13
           TERMINATE'        5               ?
           P'RESET           6               ?
           P'REWRITE         7               ?
           P'CLOSEIO        10               ?
           P'INITHEAP'3000  11               ?
           TWO               2    71   123
           P'WRITELN        12               ?
           P'WRITESTR       13               ?
           ONE               3   142   155
           SEGMENT LENGTH        210

        PRIMARY DB          2    INITIAL STACK   10240    CAPABILITY        600
        SECONDARY DB      430    INITIAL DL          0    TOTAL CODE        210
        TOTAL DB          432    MAXIMUM DATA        ?    TOTAL RECORDS      11
        ELAPSED TIME   00:00:01.365                  PROCESSOR TIME   00:00.740

        END OF PREPARE

     %cmdebug > wl cmstart(ob') 
     PROG %0.0
     %cmdebug > wl cmstart(two) 
     PROG %0.71
     %cmdebug > wl cmstart(one) 
     PROG %0.142

     %cmdebug > wl cmproclen(ob') 
     %71
     %cmdebug > wl cmstart(two) - cmstart(ob') 
     %71

     %cmdebug > wl cmproclen(two) 
     %51
     %cmdebug > wl cmstart(one)-cmstart(two) 
     %51

     %cmdebug > wl cmproclen(one) 
     %30

Limitations, Restrictions 

The names and addresses of nested CM procedures, such as procedure three,
are not available within the CM FPMAP records.  Addresses that fall
within nested procedures (three) are returned as offsets relative to the
parent procedure (two).



MPE/iX 5.0 Documentation