Debugging with GDB Manual The GNU Source-Level Debugger (769148-001, March 2014)
Scrolling panes
To scroll within a pane, you can use the arrow keys or the Page Up and Page Down keys (on some
keyboards these are Prev and Next). You can also use the following commands:
{+ | -} [num_lines]
[win_name]
Vertically scroll the pane forward (+) or backward (-). + or
- with no arguments scrolls the pane forward or backward
one page. Use num_lines to specify how many lines to scroll
the pane. Use win_name to specify a pane other than the
one with logical focus.
{< |>} [num_char]
[win_name]
Horizontally scroll the pane left (<) or right (>) the specified
number of characters. If you do not specify num_char, the
pane is scrolled one character.
Note that a space is required between the +, -, <, or > and the number.
To scroll the command pane, use the scroll bars on the terminal pane.
Changing the register display
To look at the floating-point or special registers instead of the general registers, and then to return
to the general registers, you can use the following XDB commands:
fr, display $fregs Display the floating-point registers.
sr, display $sregs Display the special registers.
gr, display $gregs Display the general registers.
For example, if you use the fr command, the window looks like this:
|-------------------------------------------------------------------------|
|flags 29000041 r1 51a800 rp 7f6ce597 |
|r3 7f7f0000 r4 1 r5 7f7f06f4 |
|r6 7f7f06fc r7 7f7f0800 r8 7f7f0800 |
|r9 40006b10 r10 0 r11 40004b78 |
|r12 1 r13 0 r14 0 |
|r15 0 r16 40003fb8 r17 4 |
:......................................................................:
:30 { :
:31 /* Try two test cases. */ :
*>:32 print_average (my_list, first, last); :
:33 print_average (my_list, first, last - 3); :
:34 } :
:35 :
:......................................................................:
File: average.c Procedure: main Line: 32 pc: 0x3524
(gdb) la regs
(gdb) la src
(gdb) la regs
(gdb) foc next
Focus set to REGS window.
(gdb) fr
#0 main () at average.c:32
(gdb)
The default floating-point register display is single-precision. To change the register display to
double-precision and then back again, use the XDB toggle float command:
toggle $fregs
The window looks like this:
|-------------------------------------------------------------------------|
192 The HP-UX Terminal User Interface