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

Create a safe, straightforward API to capture JS stacks #14987

Closed
jdm opened this issue Jan 12, 2017 · 6 comments
Closed

Create a safe, straightforward API to capture JS stacks #14987

jdm opened this issue Jan 12, 2017 · 6 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Jan 12, 2017

https://github.com/servo/mozjs/blob/3f38435122538e4b66f88878302f81331c0b6a44/mozjs/js/src/jsapi.h#L5895-L6039 looks like it gives us the building blocks we need in C++. We should make it as easy to capture JS stacks as possible and use them to help us debug problems with web compatibility.

@jdm
Copy link
Member Author

@jdm jdm commented Mar 18, 2017

The idea here is that CaptureCurrentStack gives us a JSObject that represents a captured stack. BuildStackString accepts a JSObject representing a captured stack and yields a string representation of the stack. A great way to start would be to make a Rust type that captures the stack in its constructor, and has a method that returns a Rust string representation. This type will need to refer to store a RootedGuard, meaning that it refers to a rooted JS object that was created earlier in the program. This object will store the captured stack.

@jdm
Copy link
Member Author

@jdm jdm commented Mar 18, 2017

It would make the most sense to build this in the rust-mozjs repository, rather than in servo itself.

@mrowqa
Copy link

@mrowqa mrowqa commented Nov 24, 2017

Hi, I will work on this. I have already read the code around and this seems like quite easy task.

@jdm
Copy link
Member Author

@jdm jdm commented Nov 24, 2017

@mrowqa Great! Please ask questions if anything is unclear!

@jdm jdm added the C-assigned label Nov 24, 2017
bors-servo added a commit to servo/rust-mozjs that referenced this issue Dec 1, 2017
Safe, straightforward API for capturing JS stacks

PR for servo/servo#14987

Can someone take a look if it goes in the right direction and also look through my comments? Maybe, I have left some "stupid questions", but I wanted to post my changes and get feedback before weekend - I work from Europe, so here is middle of the night.

CC: @jdm

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-mozjs/381)
<!-- Reviewable:end -->
@mrowqa
Copy link

@mrowqa mrowqa commented Dec 2, 2017

@jdm Is that all or do we want something more? And thank you for the help :)

@jdm
Copy link
Member Author

@jdm jdm commented Dec 2, 2017

Good enough for now!

@jdm jdm closed this Dec 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.