Repository navigation
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34081. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
See #31204 (comment) |
|
re: @maflcko
I didn’t see this, thank you. The issue points exactly to the problem I’m trying to fix. I see that the proposed solution in #32205 addresses the problem by updating the documentation. While that might work, it doesn’t actually fix the underlying issue and requires updating the paths for each build (some users may run |
|
How is your patch different from just removing the prefix-map option? |
|
As I understand the problem, the solution is not removing the prefix-map option but changing where it points. This can be done either in i propose modifying the cmake: The #32205 proposes suggesting users to modify the debugger config: It will have the same outcome, but mine will be automatically done. Also it is more interoperable as I mentioned i it worked with gdb and lldb, while in the other case I would require to configure both debuggers |
Yes, but I am asking why? What would be the observable difference? It just seems odd to have code that doesn't achieve anything. At least last time I checked, the two seemed to achieve the same: #31957 (comment) |
|
Just tested what you mean, removed: It had the same effect, yes, make more sense removing code that makes an incorrect behaviour than adding more above it. I will try to research if it has any advantages, but in other cas,e the correct approach should be to remove the incorrect mapping Edit: @hebasto pointed out that removing it might resurface an issue (#30799.) I will try to look into it #31957 (comment) |
This may be a macro, and not the debug info, so may be fine, but I haven't checked this. |
|
I have analysed how the different debug information is stored in the master branch, using my changes and removing the remaps (your proposal ). The observable difference is in how DWARF debug information records source file paths. Here are the three scenarios I tested with objdump -g ./build/bin/bitcoind | grep -A5 -B5 "src/" First case (master branch – remap relative path for old project layout)
Second case (with my changes, remap relative path correctly)
Third case (removing the flags entirely, use absolute path)
ConclusionSo replying to:
The difference is in storing absolute paths or relative ones. The current branch is just wrong, it points incorrectly. The decision is whether you prefer a relative or an absolute path. I read on some old related issues/pr that relative paths are better for tools like ccache, but I am not an expert on that. |
It is interesting that this is using relative paths. I had the impression that
I think the ccache behavior is currently broken anyway (#30861 was closed), so there is little that can be broken by removing the code. Of course, everything will still need to be tested to confirm the fixes and no new breakages. You'll have to include in the pull request descriptions, which bugs are fixed. Also, mentioning autogen and configure doesn't really help, when the project here is using cmake. |
|
concept ACK, this works for source code in This is a much better fix than just updating docs like #32205 Example that works: bitcoind, set breakpoint at
|
|
re: @maflcko
Thank you for your feedback. This is my first PR, so any advice is welcome. I’ve edited the description to better summarize the change and to point directly to the specific bug being addressed. |
|
re: @pinheadmz
Good point, I’ll try to address this as well. Is there any other binary you’d like me to verify? I don’t think the functional tests are related to this PR, but I might be others I am missing. |
|
Concept ACK This works for me out of the box Process 98441 stopped
* thread #36, name = 'b-msghand', stop reason = breakpoint 1.1
frame #0: 0x00000001002d8a3c bitcoind`(anonymous namespace)::PeerManagerImpl::ProcessMessage(this=0x00000007e703d400, pfrom=0x0000000103b6b430, msg_type="version", vRecv=0x000000017111eb30, time_received=1766574637095060 µs, interruptMsgProc=0x00000007e703d240) at net_processing.cpp:3431:5
3428 const std::chrono::microseconds time_received,
3429 const std::atomic<bool>& interruptMsgProc)
3430 {
-> 3431 AssertLockHeld(g_msgproc_mutex);
3432
3433 LogDebug(BCLog::NET, "received: %s (%u bytes) peer=%d\n", SanitizeString(msg_type), vRecv.size(), pfrom.GetId());
3434
Target 0: (bitcoind) stopped.
(lldb) I also saw the same behaviour as @pinheadmz for test_bitcoin You can see the list of binaries using |
With the build workflow change from Autotools to CMake, the debug information became incorrect due to outdated file path remapping (#31204). This issue comes from a workaround that was needed in the previous build system (#21885 problem, which was addressed in #20353 and later again on #22409. ).
This PR attempts to resolve the problem by correcting the file path remapping for the new out-of-source build.
I have tested the fix both in the terminal using GDB and in VS Code using LLDB
After my changes, I tested by running
gdb:And also with
lldband vscode using the following.vscode/launch.json:Alternatives
If this PR is not considered, I have two alternative proposals:
set substitute-path path/to/build/src /path/to/project/root/src