HPlogo System Debug Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 4 System Debug Command Specifications

Fx (format)

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Formats a specified data structure.

Syntax

   FT          path ft_options



   FV virtaddr path fv_options

FT = format data structure with type information.

FV = format data structure with data starting at sid.off.

Parameters

virtaddr

FV only. The virtual address of the data to be formatted. Virtaddr can be a short pointer, a long pointer, or a full logical code pointer.

path

A path specification, as described in chapter 5, "Symbolic Formatting/Symbolic Access".

ft_options

These options are for the FT command only. The MAP option causes a location map to be printed for components of complex structures such as records or arrays.

MAP

Include a location map.

NOMAP

Do not include a location map (default).

fv_options

These options are for the FV command only.

PAC

Print packed array of chars as a string of characters.

NOPAC

Print packed array of chars as an array index followed by the element value.

PAB

Print packed array of boolean as a bit string.

NOPAB

Print packed array of boolean as an array index followed by the element value.

ARCH

For selected MPE/XL architect types, print the data in the "expected" fashion.

NOARCH

Do no special formatting for MPE/XL architected types.

If no options are given, the default set is:

   PAC  PAB  ARCH

The known types given special treatment with the ARCH option are:

   VA_TYPE         

   SHORT_VA_TYPE   

   CONVERT_PTR_TYPE

Examples

   $nmdebug > symopen gradtyp.demo

Opens the symbolic data type file gradtyp.demo. It is assumed that the Debug variable addr contains the address of a StudentRecord data structure in virtual memory. The following code fragment is from this file:

   CONST         MINGRADES    = 1;           MAXGRADES    = 10;

                 MINSTUDENTS  = 1;           MAXSTUDENTS  = 5;



   TYPE

      GradeRange     = MINGRADES . . MAXGRADES;

      GradesArray    = ARRAY [ GradeRange  ] OF integer;

      Class          = ( SENIOR,  JUNIOR,  SOPHOMORE,  FRESHMAN );

      NameStr        = string[8];

      StudentRecord  = RECORD

                          Name        : NameStr;

                          Id          : integer;

                          Year        : Class;

                          NumGrades   : GradeRange;

                          Grades      : GradesArray;

                       END;

FT (Format Type) Examples

   $nmdebug > FT "StudentRecord"



   RECORD

      NAME     : NAMESTR ;

      ID       : INTEGER ;


      YEAR     : CLASS ;

      NUMGRADES: GRADERANGE ;

      GRADES   : GRADESARRAY ;

   END

Display the structure of StudentRecord.

   $nmdebug > FT "StudentRecord" MAP



   RECORD

      NAME     : NAMESTR ;   ( 0.0 @ 10.0 )

      ID       : INTEGER ;   ( 10.0 @ 4.0 )

      YEAR     : CLASS ;   ( 14.0 @ 1.0 )

      NUMGRADES: GRADERANGE ;   ( 15.0 @ 1.0 )

      GRADES   : GRADESARRAY ;   ( 18.0 @ 28.0 )

   END ;

   RECORD Size: 40 bytes

Display the structure of StudentRecord and print a component map.

   $nmdebug > FT "StudentRecord.grades"

   ARRAY [ GRADERANGE  ] OF INTEGER



   $nmdebug > FT "graderange"

   1 .. 10



   $nmdebug > FT "maxgrades"

   INTEGER

Display various types. Notice that structure name is not limited to a simple type or constant name; rather, it may consist of any composite structure name.

FV (Format Virtual) Examples

The following examples assume that debug variable data contains the virtual address of a data structure corresponding to the type StudentArray.

Before looking at FV examples, let's take a look at the data for student number 1 the "old fashioned way" (with the DV command):

   $nmdebug > dv data,10 

   $ VIRT 7b8.40200010 $ 00000004 42696c6c 00000000 00000000

   $ VIRT 7b8.40200020 $ 00000001 00040000 0000002d 00000041

   $ VIRT 7b8.40200030 $ 0000004e 00000042 00000000 00000000

   $ VIRT 7b8.40200040 $ 00000000 00000000 00000000 00000000



   $nmdebug > dv data,6,a

   $ VIRT 7b8.40200010 A .... Bill .... .... .... ....

This is what the first few words of the StudentArray data looks like in virtual memory.

   $nmdebug > fv data "StudentRecord"



   RECORD

      NAME      : 'Bill'

      ID        : 1

      YEAR      : SENIOR

      NUMGRADES : 4

      GRADES    :

         [ 1 ]: 2d

         [ 2 ]: 41

         [ 3 ]: 4e

         [ 4 ]: 42

         [ 5 ]: 0

         [ 6 ]: 0

         [ 7 ]: 0

         [ 8 ]: 0

         [ 9 ]: 0

         [ a ]: 0

   END

This is what the first element of the StudentArray data looks like when formatted as if it were a StudentRecord.

   $nmdebug > fv data "StudentRecord.Name" 



   'Bill'



   $nmdebug > fv data "StudentRecord.Year" 



   SENIOR



   $nmdebug > fv data "StudentRecord.Grades[3]" 



   4e

MPE XL Operating System Examples

We can also look at individual items of a data structure as the above examples depict.

   $nmdebug > symopen symos.pub.sys

   $nmdebug > fv pib(pin) "pib_type.cm_global"

   c79c0000

Open the operating system symbolic file. Format the data in the cm_global field of the PIB for the current PIN. It is a short pointer.

    $nmdebug > fv pib(pin) "pib_type.cm_global^" 

   PACKED RECORD

      CM_DP0          : 0

      CM_DP_SCRATCH   : c0105d40

      CM_INFO         :

            CM_INFO_INT : c

      CM_CTRL         :

            CM_CTRL_INT : 0

      CM_STACK_DST    : ac

      CM_DB_DST       : ac

      CM_DB_3K_OFFSET : 200

      CM_DB_SID       : 7d4

      CM_DB_OFFSET    : 400110b0

      CM_DL           : CONVERT_PTR_TYPE( 7d4.40011000  )

      CM_S            : CONVERT_PTR_TYPE( 7d4.400110be  )

      CM_Z            : CONVERT_PTR_TYPE( 7d4.40015ed0  )

      CM_STACK_BASE   : CONVERT_PTR_TYPE( 7d4.40010cb0  )

      CM_STACK_LIMIT  : CONVERT_PTR_TYPE( 7d4.40020fff  )

      CM_CST          : 80000700

      CM_CSTX         : 0

      CM_LSTT         : CONVERT_PTR_TYPE( 0.0  )

      CM_NRPGMSEGS    : 0

      CM_DST          : 81400000

      CM_BANK0        : 80000000

      CM_BANK0_SIZE   : 10000

      CM_DEBUG        : 0

      CM_MCODE_ADR    : 484228

      CM_RESVD6       : 0

      CM_RESVD5       : 0

      CM_RESVD4       : 0

      CM_RESVD3       : 0

      CM_RESVD2       : 0

      CM_RESVD1       : 0

   END

Format the data in the cm_global field of the PIB for the current PIN. That is, format what the pointer points to.

   $nmdebug > fv pib(pin) "pib_type.cm_global^.cm_info"

   CRUNCHED RECORD

         CM_INFO_INT : c

   END

Format the data in the cm_info record of the cm_global record.

   $nmdebug > ft "pib_type.cm_global^.cm_info" 

   CRUNCHED RECORD

    CASE BOOLEAN OF

         TRUE: ( CM_INFO_INT: SEM_LOCK_TYPE );

         FALSE: ( SPLITSTACK : BIT1 ;

                 SINGLE_STEP: BIT1 ;

                 CNTRL_Y    : BIT1 ;

                 SCRATCH1   : BIT5 );

   END

Format the type for the acm_info record contained in the cm_global record. We see that the record has an invariant case structure. By default, the formatter takes the first invariant structure found.

   $nmdebug > fv pib(pin) "pib_type.cm_global^.cm_info,false" 

   CRUNCHED RECORD

         SPLITSTACK  : 0

         SINGLE_STEP : 0

         CNTRL_Y     : 0

         SCRATCH1    : c

   END 

Format the data for the cm_info record contained in the cm_global record. Note that we asked for a specific case invariant.

Limitations, Restrictions

none

CAUTION: The output format of all System Debug commands is subject to change without notice. Programs that are developed to postprocess System Debug output should not depend on the exact format (spacing, alignment, number of lines, uppercase or lowercase, or spelling) of any System Debug command output.
Feedback to webmaster