Page MenuHomePhabricator

Added developer-notes for debugging unit tests with GDB
ClosedPublic

Authored by jasonbcox on Mar 29 2018, 06:58.

Details

Summary

While using GDB to debug tests is straight forward, it's not immediately obvious that it can be done.
These notes should help developers debug their tests in a more methodical manner.

Test Plan

I do this to debug tests and it works. :D

Diff Detail

Repository
rABC Bitcoin ABC
Branch
gdb
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 2199
Build 2542: Bitcoin ABC Buildbot (legacy)
Build 2541: arc lint + arc unit

Event Timeline

doc/developer-notes.md
110

Shouldn't that go under Development tips and tricks ?

doc/developer-notes.md
110

I guess it could, but I figured this section could be expanded over time. Either way works

doc/developer-notes.md
110

Considering there is a compiling for debugging in there, I think it should be moved. Because if you don't compile for debugging, then you'll have a very fund time with gdb.

matiu added inline comments.
doc/developer-notes.md
121

Maybe add:

For OSX,  use:

cd /build/src/test
lldb -- test_bitcoin
break set --file interpreter.cpp --line 295  
run
doc/developer-notes.md
121

Then maybe we just want to direct people to lldb (this works on linux as well).

Updated according to feedback.

jasonbcox added inline comments.
doc/developer-notes.md
121

Thanks Matias! I've included both because people have differing levels of experience with different tools.

doc/developer-notes.md
149 ↗(On Diff #3501)

Or just

b interpreter.cpp:295
150 ↗(On Diff #3501)

Or just r :)

jasonbcox added inline comments.
doc/developer-notes.md
149 ↗(On Diff #3501)

I think files like this that are intended for newbies provide the most help when instructions are written out.

This revision is now accepted and ready to land.Apr 19 2018, 23:10
This revision was automatically updated to reflect the committed changes.