Next: Searching Memory, Previous: Character Sets, Up: Data
gdb caches data exchanged between the debugger and a remote target (see Remote Debugging). Such caching generally improves performance, because it reduces the overhead of the remote protocol by bundling memory reads and writes into large chunks. Unfortunately, simply caching everything would lead to incorrect results, since gdb does not necessarily know anything about volatile values, memory-mapped I/O addresses, etc. Furthermore, in non-stop mode (see Non-Stop Mode) memory can be changed while a gdb command is executing. Therefore, by default, gdb only caches data known to be on the stack1. Other regions of memory can be explicitly marked as cacheable; see see Memory Region Attributes.
set remotecache on
set remotecache off
show remotecache
set stack-cache on
set stack-cache off
ON
, use
caching. By default, this option is ON
.
show stack-cache
info dcache
[line
]If a line number is specified, the contents of that line will be
printed in hex.
set dcache size
sizeset dcache line-size
line-sizeshow dcache size
show dcache line-size
[1] In non-stop mode, it is moderately rare for a running thread to modify the stack of a stopped thread in a way that would interfere with a backtrace, and caching of stack reads provides a significant speed up of remote backtraces.