The Bitcoin Core take a look at documentation offers some steering on attaching a debugger. The practical assessments are in Python so you might be accurately selecting pdb (somewhat than gdb, lldb and many others) for the job.

A python debugger will be hooked up to assessments at any level. Simply add the road: import pdb; pdb.set_trace() wherever within the take a look at. You’ll then be capable of examine variables, in addition to name strategies that work together with the bitcoind nodes-under-test.

There’s a good video tutorial here from Simeon Franklin on pdb right here. There are a lot of pdb instructions however the important thing ones you might be most probably to make use of are:

l(ist)
n(ext)
c(ontinue)
s(tep)
r(eturn)
b(reak)

As Frankin states:

l exhibits you the place you might be in your code. n steps to the following line of execution. c leaves debugger management and executes your code usually. s steps into the following line of execution together with into operate calls in the event that they exist. r steps to the top of the presently executing operate and b units breakpoints. You will need to notice when you find yourself debugging that from the pdb console you may kind in any legitimate Python, altering variables or execution stream of your program and inspecting their values.

Extra detailed steering on utilizing pdb is on python.org however the above needs to be a very good introduction.

Keep in mind that you’re making edits to Pieter Wuille’s taproot department domestically and won’t ever push them to GitHub so you may make no matter adjustments you need. If you wish to revert again to Pieter Wuille’s code earlier than you began making edits (and discard your whole edits) you may run

git reset --hard HEAD

after which you ought to be again to the state earlier than you began experimenting.

Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here