| www.delorie.com/gnu/docs/gdb/gdb_86.html | search |
![]() Buy the book! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To use GDB's overlay support, each overlay in your program must correspond to a separate section of the executable file. The section's virtual memory address and load memory address must be the overlay's mapped and load addresses. Identifying overlays with sections allows GDB to determine the appropriate address of a function or variable, depending on whether the overlay is mapped or not.
GDB's overlay commands all start with the word overlay;
you can abbreviate this as ov or ovly. The commands are:
overlay off
overlay manual
overlay map-overlay and overlay unmap-overlay
commands described below.
overlay map-overlay overlay
overlay map overlay
overlay unmap-overlay overlay
overlay unmap overlay
overlay auto
overlay load-target
overlay load
overlay list-overlays
overlay list
Normally, when GDB prints a code address, it includes the name of the function the address falls in:
(gdb) print main
$3 = {int ()} 0x11a0 <main>
|
foo is a function in an
unmapped overlay, GDB prints it this way:
(gdb) overlay list
No sections are mapped.
(gdb) print foo
$5 = {int (int)} 0x100000 <*foo*>
|
foo's overlay is mapped, GDB prints the function's
name normally:
(gdb) overlay list
Section .ov.foo.text, loaded at 0x100000 - 0x100034,
mapped at 0x1016 - 0x104a
(gdb) print foo
$6 = {int (int)} 0x1016 <foo>
|
When overlay debugging is enabled, GDB can find the correct
address for functions and variables in an overlay, whether or not the
overlay is mapped. This allows most GDB commands, like
break and disassemble, to work normally, even on unmapped
code. However, GDB's breakpoint support has some limitations:
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |