HPlogo System Debug Reference Manual > Chapter 6 System Debug Command Specifications M-X

PSEUDOMAP

MPE documents

Complete PDF
Table of Contents
Index

E0201 Edition 4 ♥
E0300 Edition 3
E0692 Edition 3

Logically maps a local file into virtual memory, utilizing symbol information in library/program files.

Syntax



   PSEUDOMAP local_file space_id [loaded_fname] [offset]

The PSEUDOMAP command is used to fill in parts of virtual memory that are not accessible in a dump. When a file is mapped using PSEUDOMAP, the file appears to be loaded in virtual memory at the specified location. When portions of this virtual memory cannot be read from the dump, corresponding locations from the PSEUDOMAPped file are read instead.

The PSEUDOMAP command is also used to provide access to procedure name symbol information stored in local native mode program files or executable libraries. When one of these files is mapped into memory its symbols are preprocessed. The file is then 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, 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 PSEUDOMAPped file. The process of converting a symbol name to an address involves scanning 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: MAPLIST, UNMAP

Parameters


local_file

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

space_id

Associate symbols from local_file 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.

offset

Associate local_file with this offset within the space.

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




PROCLIST


PURGEDUMP