aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2017-07-19 22:45:22 +0200
committerMarcoFalke <falke.marco@gmail.com>2017-07-19 22:45:27 +0200
commitdf0793f324e33066cc746c0cb1d053d35733d626 (patch)
treeb100194a441e83e2c9b7d16b3caf8d672466c5c3 /test
parentd445a2c2eaa176e29075efd21c177080cf9776f1 (diff)
parent7ec3343df21aae30bf782f77171f5e4d9a1d5e65 (diff)
downloadbitcoin-df0793f324e33066cc746c0cb1d053d35733d626.tar.xz
Merge #10681: add gdb attach process to test README
7ec3343 add gdb attach process to test README (Gregory Sanders) Pull request description: Saved me many hours. h/t to @jnewbery for the new guide efforts Tree-SHA512: 4d8ba1717eb842201079488f1cfe369d5d5114df5278643a3f996c986a51e3e039ea994a6f2f06bf6607b697388ad6561198da4693e3cb1ca4a8424e6d423d85
Diffstat (limited to 'test')
-rw-r--r--test/README.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/README.md b/test/README.md
index 15f6df790f..868eb667ae 100644
--- a/test/README.md
+++ b/test/README.md
@@ -155,6 +155,26 @@ import pdb; pdb.set_trace()
anywhere in the test. You will then be able to inspect variables, as well as
call methods that interact with the bitcoind nodes-under-test.
+If further introspection of the bitcoind instances themselves becomes
+necessary, this can be accomplished by first setting a pdb breakpoint
+at an appropriate location, running the test to that point, then using
+`gdb` to attach to the process and debug.
+
+For instance, to attach to `self.node[1]` during a run:
+
+```bash
+2017-06-27 14:13:56.686000 TestFramework (INFO): Initializing test directory /tmp/user/1000/testo9vsdjo3
+```
+
+use the directory path to get the pid from the pid file:
+
+```bash
+cat /tmp/user/1000/testo9vsdjo3/node1/regtest/bitcoind.pid
+gdb /home/example/bitcoind <pid>
+```
+
+Note: gdb attach step may require `sudo`
+
### Util tests
Util tests can be run locally by running `test/util/bitcoin-util-test.py`.