Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The stacktrace provided in #2056 notably differs from the one we recover from the logs in that it includes inline frames.
In order to get those, we need to directly use dbghelp instead of going through dbh. This also solves a lot of clunkiness surrounding base addresses, as well as the issue that dbh did not appear to work with non-ASCII paths (what year is this).
Further, GitHub now automatically renders code snippets, so use that by default instead of
[`file:line`](link)
markdown.In order to have more context in the snippet, make the snippet range from the start of the symbol to the line corresponding to the stack frame. Make the trace most-recent-call-last so that the sequence of snippets reads monotonically.
Note that since our stack does not include the line with the failing check, we miss any inline frames between the check and the next non-inline frame, and we do not get a snippet for the check itself.
We should probably omit one frame fewer.
Example with the stacktrace from #2056:
Old output:
Renders as:
ksp_plugin/pile_up.cpp:131
base/thread_pool_body.hpp:15
base/thread_pool_body.hpp:80
New output:
Renders as:
Principia/base/thread_pool_body.hpp
Lines 57 to 80 in 3e2334a
Principia/base/thread_pool_body.hpp
Lines 14 to 15 in 3e2334a
Principia/ksp_plugin/plugin.cpp
Line 719 in 3e2334a
Principia/ksp_plugin/pile_up.cpp
Lines 126 to 131 in 3e2334a
New output with
--no-snippet --no-comment
:Renders as:
base/thread_pool_body.hpp:80
base/thread_pool_body.hpp:15
ksp_plugin/plugin.cpp:719
ksp_plugin/pile_up.cpp:131