Skip to content

Conversation

theuni
Copy link
Member

@theuni theuni commented Jun 8, 2016

Addresses #7770, though only Linux and Windows for now. OSX will need a little more attention, since dsymutil isn't yet built as part of our toolchain.

To test, simply untar/unzip the new -debug files in the same path as the binaries, and gdb should find them automatically.

To make my life easier while I was in there, I fixed up depends to play nice with CONFIG_SITE, which can be used now instead of abusing --prefix, though the --prefix hack still works fine.

Now, configure can also be run like:

CONFIG_SITE=$PWD/depends/x86_64-pc-linux-gnu/share/config.site --prefix=/whatever/you/want

theuni added 3 commits June 7, 2016 22:10
This does not break any existing prefix behavior, only makes new behavior work.

For example:
CONFIG_SITE=$PWD/depends/x86_64-pc-linux-gnu/share/config.site ./configure --prefix=/
The -debug tarballs/zips contain detached debugging symbols. To use them, place
in the same dir as the target binary, and invoke gdb as usual.

Also, because the debug symbols add a substantial space requirement, the build
dirs are now deleted when they're no longer needed.
@laanwj
Copy link
Member

laanwj commented Jun 8, 2016

Very cool!
utACK 7e7eb27

@jonasschnelli
Copy link
Contributor

Nice utACK 7e7eb27

@sipa
Copy link
Member

sipa commented Jun 8, 2016

Concept ACK

@laanwj
Copy link
Member

laanwj commented Jun 8, 2016

Tested ACK for Linux (gitian-built executables):

  • Generating a backtrace shows names and debug info when loading the symbols in gdb, but not when not having loaded the symbols (e.g. when moving the .gdb out of the way)
  • addr2line works
$ addr2line -Caife bitcoind.dbg 0xb258c                                                           
0x00000000000b258c
ReadBlockFromDisk(CBlock&, CBlockIndex const*, Consensus::Params const&)
/home/ubuntu/build/bitcoin/distsrc-x86_64-unknown-linux-gnu/src/main.cpp:1562

Haven't tested windows yet.

@laanwj
Copy link
Member

laanwj commented Jun 8, 2016

Hm, only tangentially related to this pull, but this is strange, looks like windows .zip still has bench_bitcoin.exe:

-rwxr-xr-x 1 orion orion   2886675 Jan  1 00:00 bench_bitcoin.exe
-rwxrwxr-x 1 orion orion  15123409 Jan  1 00:00 bench_bitcoin.exe.dbg

Seems I overlooked that one in #7776 (gitian-win.yml doesn't have the --disable-bench). Fixed in #8175.

@laanwj
Copy link
Member

laanwj commented Jun 8, 2016

Tested ACK Windows:

$ /usr/bin/x86_64-w64-mingw32-addr2line -Caife bitcoind.exe.dbg 504000                                   
0x0000000000504000
CBlockIndex::GetMedianTimePast() const
/home/ubuntu/build/bitcoin/distsrc-x86_64-w64-mingw32/src/chain.h:291
UpdateTime(CBlockHeader*, Consensus::Params const&, CBlockIndex const*)
/home/ubuntu/build/bitcoin/distsrc-x86_64-w64-mingw32/src/miner.cpp:62

(haven't tried mingw-wine gdb, but I believe you that it works)

@theuni
Copy link
Member Author

theuni commented Jun 8, 2016

I tried it insomuch as gdb finds the symbols, but I had other local issues preventing gdb from working with wine. I'm not sure that I've ever actually used gdb for win debugging.

I'm assuming most windows crash investigations will happen via add2rline, but if you've used gdb that way in the past and would like to verify that it works, I'll see if I can work out my issue and test.

@laanwj laanwj merged commit 7e7eb27 into bitcoin:master Jun 9, 2016
laanwj added a commit that referenced this pull request Jun 9, 2016
7e7eb27 gitian: create debug packages for linux/windows (Cory Fields)
ad38204 gitian: use CONFIG_SITE rather than hijacking the prefix (Cory Fields)
b676f38 depends: allow for CONFIG_SITE to be used rather than stealing prefix (Cory Fields)
@laanwj
Copy link
Member

laanwj commented Jun 9, 2016

I'm assuming most windows crash investigations will happen via add2rline, but if you've used gdb that way in the past and would like to verify that it works, I'll see if I can work out my issue and test.

Yes, I've done so once, it was not a very pleasant experience.
No need to spend more work there, that's so rare that we can fix it up if it happens to not work then.

laanwj added a commit to laanwj/bitcoin that referenced this pull request Jun 21, 2016
Mention ARM executables in the release process documentation
(these were introduced in bitcoin#8188).
As well as that Linux tarballs have changed name to contain an
architecture tuple, instead of `linux32`/`linux64`.
Also mention that `-debug` files should not be uploaded (these were
introduced in bitcoin#8167).
zkbot pushed a commit to zcash/zcash that referenced this pull request Oct 17, 2016
Upstream gitian updates

This PR pulls in all gitian-related PRs that have been merged upstream since 0.11.2. The only ones I left out were documentation-only PRs, because we removed `doc/gitian-building.md` at some point. Here are the commits applied here, in the order shown in `git log` (ie. last to first):

- bitcoin/bitcoin#7283
  - fa42a67
  - fa58c76
- bitcoin/bitcoin#8175
  - 74c1347
- bitcoin/bitcoin#8167
  - 7e7eb27
  - ad38204
  - b676f38
- bitcoin/bitcoin#7776
  - f063863
- bitcoin/bitcoin#7424
  - a81c87f ~ we already partly applied
  - a8ce872
  - f3d3eaf ~ we already partly applied
  - 475813b
  - ~~cd27bf5~~ X we already applied
- bitcoin/bitcoin#7060
  - 3b468a0 ~ we removed doc/gitian-building.md
  - ~~99fda26~~ X we removed doc/gitian-building.md
- bitcoin/bitcoin#7251
  - fa09562
- bitcoin/bitcoin#6900
  - ~~2cecb24~~ X we removed doc/gitian-building.md
  - 957c0fd
  - 2e31d74
  - ~~0b416c6~~ X we removed QT
  - 9f251b7
- bitcoin/bitcoin#6854
  - 579b863 ~ we already partly applied

Part of #540
schinzelh pushed a commit to dashpay/dash that referenced this pull request Oct 19, 2017
Mention ARM executables in the release process documentation
(these were introduced in bitcoin#8188).
As well as that Linux tarballs have changed name to contain an
architecture tuple, instead of `linux32`/`linux64`.
Also mention that `-debug` files should not be uploaded (these were
introduced in bitcoin#8167).
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants