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

automatic LLNODE_RANGESFILE #91

Closed
brendangregg opened this issue Jun 1, 2017 · 5 comments
Closed

automatic LLNODE_RANGESFILE #91

brendangregg opened this issue Jun 1, 2017 · 5 comments

Comments

@brendangregg
Copy link
Contributor

Currently we do this for v8 findjsobjects to work:

# ./scripts/readelf2segments.py /var/cores/core.node.30833.1468367170 > core.30833.ranges
# export LLNODE_RANGESFILE=core.30833.ranges

It might be nice if llnode could do this automatically, even if it means llnode shelling out to call readelf and scraping the output (if that's possible in lldb).

@indutny
Copy link
Member

indutny commented Jun 2, 2017

This is not required with (I believe) lldb-3.9, as it can infer this information automatically with LLDB's APIs.

@indutny
Copy link
Member

indutny commented Jun 2, 2017

cc @hhellyer

@bnoordhuis
Copy link
Member

Correct, llnode uses lldb::SBProcess::GetMemoryRegions() when available.

@hhellyer
Copy link
Contributor

hhellyer commented Jun 2, 2017

I added the memory region API to lldb a while ago: https://reviews.llvm.org/D20565, I think it was released in lldb 3.9.
You need to build against at least a 3.9 level of lldb with the 3.9 headers. Installing via the npm installer on Linux should get that right.

On Mac it's more complicated as Apple change the version numbers so it's hard to map the version numbers of lldb across but I have confirmed the latest lldb in Xcode has that API and updated the installation script: #79

You can tell if it's enabled and you've built against the right headers as the #ifdef at: https://github.com/nodejs/llnode/blob/master/src/llnode.cc#L316 ensures the help text explaining to use the LLNODE_RANGESFILE env var is only printed if you need to set it.

@brendangregg
Copy link
Contributor Author

Wow, great, thanks! I've updated my (makeshift) docs, and will close this ticket.

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

No branches or pull requests

4 participants