docs/debugging.md: mention another method of helping gdb find sources

Signed-off-by: Botond Dénes <bdenes@scylladb.com>
Message-Id: <20200225124701.80706-1-bdenes@scylladb.com>
This commit is contained in:
Botond Dénes
2020-02-25 14:47:01 +02:00
committed by Tomasz Grabiec
parent e17db536fd
commit 4da0a1d397

View File

@@ -117,7 +117,7 @@ can fix it or report it. To enable this run:
Often you find yourself debugging an executable, whose internal source
paths don't match those where they can be found on your machine. There
is an easy workaround for this:
is an easy workaround for this:
(gdb) set substitute-path /path/to/src/in/executable /path/to/src/on/your/machine
@@ -129,6 +129,14 @@ GDB find the sources on your machine via:
(gdb) set substitute-path /opt/src/scylla /home/joe/work/scylla
This method might not work if the sources do not have a prefix, e.g.
they are relative to the source tree root directory. In this case you can use the
`set directories` command to set the search path of sources for gdb:
(gdb) set directories /path/to/scylla/source/tree
Multiple directories can be listed, separated with `:`.
#### .gdbinit
GDB supports writing arbitrary GDB commands in any file and sourcing it.