HP 3000 Manuals

XL [ System Debug Reference Manual ] MPE/iX 5.0 Documentation


System Debug Reference Manual

XL 

Utilizes symbol information in a local library/program file.

Syntax 

     XL localfile space_id [loaded-fname]

The XL command is used to provide access to procedure name symbol
information stored in a local native mode program file or executable
library disk file.  The specified file is mapped into memory and the
symbols are preprocessed.  The file is inserted into the list of loaded
files (see the LOADINFO command).  If the specified space ID is not
already part of the list of loaded files, it is added at the end of the
list but before the entry for NL.PUB.SYS. If the space ID is already
present in the list, the entry is inserted just before the entry with the
same space ID.

Any attempt to convert an address in the specified space ID to a symbol
name uses the symbol information in the XL file.  The process of
converting a symbol name to an address scans the list of loaded files
checking each one in turn for the symbol name of interest.  If the loaded
file list contains more than one entry for a space ID (as created by this
command), only the first one in the list is searched.

Related commands:  XLD, XLL

Parameters 

localfile        The name of the local program/library file from which to
                 obtain symbol information from.

space_id         Associate symbols from localfile with this space.  Any
                 attempt to convert a symbol address in this space to an
                 address, uses the local file for symbol name lookups.

loaded-fname     Bind this file name to all symbols from space space_id.
                 All of the commands and functions that deal with file
                 names (for example, the NMPATH function and NM program
                 window) use this file name any time a file name is to be
                 associated with a space ID.

Examples  

     $nmdebug > wl FOPEN  
     SYS $a.3e1130

     $nmdebug > map nl.build 
     1  NL.BUILD.CMDEBUG   4ef.0 Bytes = c5f600

     $nmdebug > xl nl.build 4ef nl.pub.sys 
     Preprocessing NL.BUILD.CMDEBUG, please wait...Done

     $nmdebug > dc FOPEN 3 
     USER $4ef.4c5138
     004c5138  FOPEN         6bc23fd9  STW      2,-20(0,30)
     004c513c  FOPEN+$4      37de00d0  LDO      104(30),30
     004c5140  FOPEN+$8      4bdf3f09  LDW      -124(0,30),31

We start by seeing that the FOPEN routine is found in the SYS library at
$a.3e1130.  Next we use the map command to map a local copy of a new
version of the NL into memory.  (It gets mapped at space $4ef.)  We then
use the XL command to obtain access to the symbols in the new copy of NL.
Finally, we use the DC command to display the first few words of the
FOPEN procedure as found in the new NL (NL.BUILD.CMDEBUG).

Remember that the XL command only provides access to symbol information.
In order to display data in a file, the MAP command must be used.

     ($22) nmdat > dptree 22 
     22 (CI.PUB.SYS)

     ($22) nmdat > tr 
          PC=a.000d87f8 enable_int+$20
     * 0) SP=40224ac8 RP=a.001cfda8 notify_dispatcher.block_current_process+$268
       1) SP=40224ac8 RP=a.001d0dcc notify_dispatcher+$2b0
       2) SP=40224a10 RP=a.00291b94 wait_for_active_port+$e0
       3) SP=40224828 RP=a.00292324 receive_from_port+$22c
       4) SP=402247c0 RP=a.002c51ec extend_receive+$41c
       5) SP=402246d0 RP=a.002b5d30 rendezvousio.get_specific+$11c
       6) SP=402245b0 RP=a.002b5fb4 rendezvousio+$19c
       7) SP=40224510 RP=a.002b2398 attachio+$5e0
       8) SP=40224308 RP=a.002ad690 ?attachio+$8
            export stub: a.0061575c arg_regs+$28
       9) SP=40224050 RP=a.005984bc nm_switch_code+$9b4
       a) SP=40223f20 RP=a.0042a5bc SWT_RETURN
          (switch marker frame)
       b) SP=40223bc0 RP=a.00597274 switch_to_cm+$8c4
       c) SP=402239d0 RP=a.007499b8 tm_cms_type_mgr+$8bc
       d) SP=40223668 RP=a.0072ee44 FREAD+$3c8
       e) SP=40221780 RP=a.006ac858 readcmd+$1dc
       f) SP=40221560 RP=a.006abcc8 ?readcmd+$8
            export stub: 74.00006274
      10) SP=402211d8 RP=74.000068e0
      11) SP=40221178 RP=74.00007450
      12) SP=40221130 RP=74.00000000
          (end of NM stack)

The current PIN ($22) is the program CI.PUB.SYS. In DAT, we do a stack
trace, but we observe that the symbols for the program file are not part
of the stack trace.

     ($22) nmdat > loadinfo 
     nm SYS   NL.PUB.SYS                    SID = $a
     cm SYS   SL.PUB.SYS

     ($22) nmdat > xl ci.abuild00.official 74 ci.pub.sys 
     Preprocessing CI.ABUILD00.OFFICIAL, please wait...Done

     ($22) nmdat > loadinfo 
     nm USER  CI.PUB.SYS                    SID = $74
     nm SYS   NL.PUB.SYS                    SID = $a
     cm SYS   SL.PUB.SYS
     ($22) nmdat >

A quick check of our loaded files reveals that DAT does not know about
the symbols for CI.PUB.SYS. We now use the XL command to open a local
copy of the program file from which symbol information can be gleaned.  A
final check of the loaded file information shows that CI.PUB.SYS has
successfully been added to the list.

Note that the stack trace code works because the unwind descriptors for
CI.PUB.SYS happen to be present in the dump.  This is usually not the
case (unless the file was loaded as a "dumpworthy" file).

     ($22) nmdat > tr 
          PC=a.000d87f8 enable_int+$20
     * 0) SP=40224ac8 RP=a.001cfda8 notify_dispatcher.block_current_process+$268
       1) SP=40224ac8 RP=a.001d0dcc notify_dispatcher+$2b0
       2) SP=40224a10 RP=a.00291b94 wait_for_active_port+$e0
       3) SP=40224828 RP=a.00292324 receive_from_port+$22c
       4) SP=402247c0 RP=a.002c51ec extend_receive+$41c
       5) SP=402246d0 RP=a.002b5d30 rendezvousio.get_specific+$11c
       6) SP=402245b0 RP=a.002b5fb4 rendezvousio+$19c
       7) SP=40224510 RP=a.002b2398 attachio+$5e0
       8) SP=40224308 RP=a.002ad690 ?attachio+$8
            export stub: a.0061575c arg_regs+$28
       9) SP=40224050 RP=a.005984bc nm_switch_code+$9b4
       a) SP=40223f20 RP=a.0042a5bc SWT_RETURN
          (switch marker frame)
       b) SP=40223bc0 RP=a.00597274 switch_to_cm+$8c4
       c) SP=402239d0 RP=a.007499b8 tm_cms_type_mgr+$8bc
       d) SP=40223668 RP=a.0072ee44 FREAD+$3c8
       e) SP=40221780 RP=a.006ac858 readcmd+$1dc
       f) SP=40221560 RP=a.006abcc8 ?readcmd+$8
            export stub: 74.00006274 ci_cmd_io+$34
      10) SP=402211d8 RP=74.000068e0 main_ci+$a0
      11) SP=40221178 RP=74.00007450 PROGRAM+$218
      12) SP=40221130 RP=74.00000000
          (end of NM stack)

We again do a stack trace; this time the symbols for the program file
show up.

     $nmdat > loadinfo 
     nm SYS   NL.PUB.SYS                    SID = $a
     cm SYS   SL.PUB.SYS

     $nmdat > xl nl.build a nl.pub.sys 
     Preprocessing NL.BUILD.CMDEBUG, please wait...Done

     $nmdat > loadinfo 
     nm SYS   NL.PUB.SYS                    SID = $a
     nm SYS   NL.PUB.SYS                    SID = $a
     cm SYS   SL.PUB.SYS
     $nmdat >

We start by looking at our list of loaded files in DAT. We then proceed
to map in a local copy of an NL. Notice that there are now two entries
for NL.PUB.SYS in the loaded file list both at space $a.  Attempts to
look up symbols in space $a use the first entry in the table (which
corresponds to the file mapped with the XL command).  Likewise, attempts
to perform a name to address lookup for a symbol searches only the first
NL.PUB.SYS entry.

Limitations, Restrictions 

Information required to perform stack traces (the unwind tables) are also
part of program files and executable libraries.  When a file is opened
with this command, we should be utilizing the unwind tables found there.
This functionality is not implemented.


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.
P


MPE/iX 5.0 Documentation