Skip to content

Add depth-limited stacktraces, fix Julia 1.1 compatibility #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 1, 2025

Conversation

Sbozzolo
Copy link
Contributor

@Sbozzolo Sbozzolo commented Mar 31, 2025

I work with deep types and full stack traces are unmanagable.

This PR adds a new option @limited_trace to print stack traces with reduced type information, as shown in the screenshot below. This uses the same infrastructure introduced in Julia 1.10 to reduce verbosity of traces in REPL.

image

In this, I tried re-generating and re-running the tests. I found that support for Julia 1.1 is broken (because hasfield was introduced in Julia 1.2).

`hasfield` was introduced in Julia 1.2, so commit `b4ed757` inadvertetly
broke compatibility with version of between 1.1 and 1.2. This commit
skips the check for Julia < 1.2.
@Sbozzolo Sbozzolo force-pushed the master branch 2 times, most recently from 52e6d5e to 61c9b4a Compare March 31, 2025 23:34
@pfitzseb
Copy link
Member

pfitzseb commented Apr 1, 2025

Tests will be fixed by JuliaDebug/TerminalRegressionTests.jl#18.

Comment on lines 430 to 431
- `@trace`: Print the current stack trace.
- `@limited_trace`: Print the current stack trace with reduced type information. (Only for Julia >= 1.10)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should make the reduced info the default and add @trace_all if someone wants to print complete type info. Thoughts?

Copy link
Contributor Author

@Sbozzolo Sbozzolo Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, (that's how I would have done it, but I didn't want to change the existing behavior).

I'll update the PR with this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I applied the changes and successfully regenerated and re-run the tests.

@pfitzseb pfitzseb closed this Apr 1, 2025
@pfitzseb pfitzseb reopened this Apr 1, 2025
With this commit, Infiltrator now takes advantage the type-limited
stacktrace printing infrastructure introduced in Julia 1.10. As a
result, Infiltrator now compresses type information, greatly enhancing
readability. A new option, `@trace_all`, is added to print the full type
information.
@pfitzseb pfitzseb merged commit 5ebb95a into JuliaDebug:master Apr 1, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants