aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2021-11-26 13:51:36 +0000
committerAndrew Burgess <aburgess@redhat.com>2022-01-12 11:19:48 +0000
commit393707788800b05448201fbb184ba758e26960fd (patch)
tree678f039f2aa09dc16899e259c3530bfe6044a5aa /gdb/doc
parent8864ef428d92e58b48ec11136d3b91622345c838 (diff)
downloadgdb-393707788800b05448201fbb184ba758e26960fd.zip
gdb-393707788800b05448201fbb184ba758e26960fd.tar.gz
gdb-393707788800b05448201fbb184ba758e26960fd.tar.bz2
gdb: new 'maint flush source-cache' command
This commit adds a new 'maint flush source-cache' command, this flushes the cache of source file contents. After flushing GDB is forced to reread source files the next time any source lines are to be displayed. I've added a test for this new feature. The test is a little weird, in that it modifies a source file after compilation, and makes use of the cache flush so that the changes show up when listing the source file. I'm not sure when such a situation would ever crop up in real life, but maybe we can imagine such cases. In reality, this command is useful for testing the syntax highlighting within GDB, we can adjust the syntax highlighting settings, flush the cache, and then get the file contents re-highlighted using the new settings.
Diffstat (limited to 'gdb/doc')
-rw-r--r--gdb/doc/gdb.texinfo13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index e39815d..2864950 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -39473,6 +39473,19 @@ frame cache. This command is useful when debugging issues related to
register fetching, or frame unwinding. The command @code{flushregs}
is deprecated in favor of @code{maint flush register-cache}.
+@kindex maint flush source-cache
+@cindex source code, caching
+@item maint flush source-cache
+Flush @value{GDBN}'s cache of source code file contents. After
+@value{GDBN} reads a source file, and optionally applies styling
+(@pxref{Output Styling}), the file contents are cached. This command
+clears that cache. The next time @value{GDBN} wants to show lines
+from a source file, the content will be re-read.
+
+This command is useful when debugging issues related to source code
+styling. After flushing the cache any source code displayed by
+@value{GDBN} will be re-read and re-styled.
+
@kindex maint print objfiles
@cindex info for known object files
@item maint print objfiles @r{[}@var{regexp}@r{]}