Uh oh!
There was an error while loading. Please reload this page.
std: add std.options.debug_stacktrace_mode - #19650
Conversation
Khitiara
commented
May 8, 2024
a version that prints out stack addresses without needing any debug info (so no file, line, or symbol name info) could be useful too |
nektro
commented
May 8, 2024
afaik that's already what happens if you use |
Khitiara
commented
May 8, 2024
if you strip debug info then dumpStackTrace prints out a warning and returns early, and writeStackTrace returns error.MissingDebugInfo, though printSourceAtAddress does work for what you describe |
There was a problem hiding this comment.
Thank you. I think it is a good idea. Happy to merge if you:
- rebase on latest master
- rename "kind" to "mode" (Since "mode" applies in fewer places than "kind" it a better name when it can be used)
- expose the enum inside the
std.Optionsnamespace - default to "none" when strip is true
- double check that it still works (test it again) and let me know that you did that
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
nektro
commented
Sep 23, 2024
built llvm 19 and rebased branch last night, will address comments and re-test soon |
alexrp
commented
Jan 30, 2025
@nektro want to try getting this into 0.14.0? |
nektro
commented
Jan 30, 2025
thought 22077 might supersede this but read the description and it says it doesn't. yeah i can rebase and address the comments soon |
nektro
commented
Jan 31, 2025
reran the test above with the same file from the OP description fullslimnone |
| } | ||
| } | ||
| pub const StackTraceMode = enum { |
There was a problem hiding this comment.
@andrewrk are you fine with this being here? A bit unclear from your comment if you meant for the enum itself to be declared inside std.Options too.
this should also handle edit: |
nektro
commented
Feb 23, 2025
size comparison of the three modes |
nektro
commented
Apr 14, 2025
bump |
xdBronch
commented
Aug 2, 2025
it would also be nice if this allowed you to force enable stack traces even if maybe this could be as simple as removing the all the checks for |
alexrp
commented
Oct 4, 2025
Is this still needed with #25227? |
alexrp
commented
Apr 25, 2026
Closing on the assumption that the answer is "no", but if I'm wrong, you're of course welcome to resubmit on Codeberg. |
given the following test file we can run it with the various option values.
beyond stylistic desires, the various options also have performance and binary size ramifications.
.noneexits faster not having to inspect the program's debug info and results in a smaller file. however since this does not require the file to be stripped to get the effect, using an external debugger remains totally possible.