ILE C/C++ Programmer's Guide

Displaying Variables As Hexadecimal Values

The following example shows the steps and syntax used to dump hexadecimal variables.

  1. Enter DSPMODSRC. The Display Module Source display appears, as shown below.
  2. Set a breakpoint at line 9.
  3. Press F12 (Resume) to leave the Display Module Source display.
  4. Call the program. The program stops at the breakpoint at line 9.
  5. Enter eval test: x 32 on the debug command line, as shown below.
    +--------------------------------------------------------------------------------+
    |                              Display Module Source                             |
    | Program:   TEST1          Library:   DEBUG          Module:   MAIN             |
    |      1  struct {                                                               |
    |      2    char charValue;                                                      |
    |      3    unsigned long intValue;                                              |
    |      4  } test;                                                                |
    |      5                                                                         |
    |      6  int main(){                                                            |
    |      7    test.intValue = 10;                                                  |
    |      8    test.charValue = 'c';                                                |
    |      9    test.charValue = 11;                                                 |
    |     10    return 0;                                                            |
    |     11  }                                                                      |
    |                                                                     Bottom     |
    | Debug . . .  eval test: x 32____________________________________________       |
    | ________________________________________________________________________       |
    | F3=Exit program   F6=Add/Clear breakpoint   F10=Step   F11=Display variable    |
    | F12=Resume       F17=Watch variable   F18=Work with watch  F24=More keys       |
    +--------------------------------------------------------------------------------+
  6. The Evaluate Expression display appears. As requested, 32 bytes are shown, but only the first 8 bytes are meaningful. The left column is an offset in hex from the start of the variable. The right column is an EBCDIC character representation of the data. If no length is specified after the 'x', the size of the variable is used as the length. A minimum of 16 bytes is displayed. Press the Enter key to return to the Display Module Source display.
    +--------------------------------------------------------------------------------+
    |                              Evaluate Expression                               |
    |                                                                                |
    | Previous debug expressions                                                     |
    |                                                                                |
    | > BREAK 9                                                                      |
    | > EVAL test: x 32                                                              |
    |      00000     83000000 0000000A 00000000 00000000  - c..............          |
    |      00010     00000000 00000000 00000000 00000000  - ...............          |
    |                                                                                |
    +--------------------------------------------------------------------------------+


[ Top of Page | Previous Page | Next Page | Table of Contents ]