Skip to content
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

Less indented (but full) stacktrace in IGV #8405

Conversation

JaroslavTulach
Copy link
Contributor

Truffle stack traces are huge and long. I've noticed the current IGV implementation truncates them at depth 50 cutting out the most interesting parts. While investigating how to fix that I realized the problem is in indentation. While the indentation of the stack frames is nice, it is far less important than ability to see the whole stack.

Less Indentation

This PR inserts org.openide.nodes.Node instances for all frames in, but indents only last 24. As a result all the frames are available and the most important ones are nicely indented. CCing @sdedic, @tkrodriguez

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Feb 19, 2024
NodeStack.Frame head = locs.bottom();
ChainNode node = new ChainNode(head, head.getLookup().lookup(Node.class),
head.getNested() == null ? Children.LEAF : new ChainChildren(head));
final int indentLevel = 24;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This constant can change, but no more than to 50 as limited here.

@JaroslavTulach
Copy link
Contributor Author

@tkrodriguez can this go in? Working with deep (Enso interpreter) stacktraces is really hard when the stack is cut at 50 (uninteresting) frames!

@tkrodriguez
Copy link
Member

Why indent them at all? It certainly doesn't help with readability I think and indenting some and not all seems mildly confusing.

@JaroslavTulach
Copy link
Contributor Author

Why indent them at all?

I think you have access to the history of the code prior open sourcing, so you can find out who implemented that. Maybe @sdedic knows. My (non verified) hypothesis is: by indenting it looks more similar to VisualVM:

VisualVM indentation

It certainly doesn't help with readability

It helps me realize where is the root and where the top most frame is, but I am not the right person to discuss esthetics.

... indenting some and not all seems mildly confusing.

Please integrate whatever modification of my patch you want - even setting the indentLevel to zero or simplifying the code to have no indentation at all.

In any case not seeing the whole stack is a bug and while I can rely on my own build of IGV where the indentation is limited, I have colleagues who would like to use released version of IGV (just yesterday @Akirathan contacted me with IGV issues related to #8290). Please let us not be stopped by considering esthetics too much. I can live with whatever implementation, if it shows all the frames.

@JaroslavTulach
Copy link
Contributor Author

@tkrodriguez, do you think you can merge this PR? If you want to disable indentation, feel free to change the indentLevel constant to zero. Thank you.

@tkrodriguez
Copy link
Member

Sorry, this was merged as cb98bbf since I cherry picked it into the other PR. So it's part of 8f54b76

@tkrodriguez tkrodriguez closed this May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants