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

Comments

Projects
None yet
4 participants
@brendangregg

brendangregg commented Jun 1, 2017

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

This comment has been minimized.

Show comment
Hide comment
@indutny

indutny Jun 2, 2017

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@indutny
Member

indutny commented Jun 2, 2017

@bnoordhuis

This comment has been minimized.

Show comment
Hide comment
@bnoordhuis

bnoordhuis Jun 2, 2017

Member

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

Member

bnoordhuis commented Jun 2, 2017

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

@hhellyer

This comment has been minimized.

Show comment
Hide comment
@hhellyer

hhellyer Jun 2, 2017

Collaborator

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.

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@brendangregg

brendangregg Jun 3, 2017

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

brendangregg commented Jun 3, 2017

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