Skip to content

Display artificial stack frames as calls to functions instead of text #2461

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 13 commits into from
Apr 7, 2021

Conversation

dkhalanskyjb
Copy link
Collaborator

Fixes #2291

import kotlinx.coroutines.*

/**
* A collection of artificial stack trace elements to be included in stack traces by the coroutines machinery.
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can slightly improve this documentation: mention that it is for debugging purposes only and leave links to to the debug mode document and the corresponding property

@dkhalanskyjb dkhalanskyjb force-pushed the no-backspace-in-traces branch 2 times, most recently from 8807021 to 06ca058 Compare January 18, 2021 10:26
@dkhalanskyjb dkhalanskyjb force-pushed the no-backspace-in-traces branch from 06ca058 to 3bd0554 Compare February 26, 2021 08:05
@dkhalanskyjb
Copy link
Collaborator Author

dkhalanskyjb commented Feb 26, 2021

I tested IDE navigation in this program: https://github.com/dkhalanskyjb/testRepo/tree/check-stacktrace-navigation. I couldn't make it break and can't imagine a reason for the current solution to fail.

Though the namespace pollution does worry me, it is the case that at the time when the sources for a dependency are not yet downloaded, IDE is unable to determine where CoroutineDebugging.kt is, so relying on actually having classfiles with correct names seems inevitable.

@dkhalanskyjb dkhalanskyjb force-pushed the no-backspace-in-traces branch from 119e84a to 806c67c Compare March 26, 2021 08:39
@dkhalanskyjb dkhalanskyjb requested a review from qwwdfsad April 6, 2021 13:54
Copy link
Collaborator

@qwwdfsad qwwdfsad left a comment

Choose a reason for hiding this comment

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

Great job! 👍

@dkhalanskyjb dkhalanskyjb force-pushed the no-backspace-in-traces branch from 806c67c to 619d262 Compare April 7, 2021 13:41
@dkhalanskyjb dkhalanskyjb merged commit b61a66c into develop Apr 7, 2021
@dkhalanskyjb dkhalanskyjb deleted the no-backspace-in-traces branch April 7, 2021 14:11
dkhalanskyjb added a commit that referenced this pull request May 11, 2021
#2461 introduced
a problem where the coroutine debugger in the IDE would crash:
#2690

According to @nikita-nazarov, the coroutine debugger crashes at a
point where a stack trace is already available and the IDE plugin
attempts to look up every class listed in the stack trace.

The new classes listed in the artificial stack frames were never
loaded, as only their names were accessed. Now, we force these
classes to be loaded, and it seems like the crash disappears.
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