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
findjsobjects #9
Comments
Thank you for kind words, @yunong ! It is definitely possible, though, the code will be very different from the mdb_v8. The reason for this is that lldb does not provide any information about mmap regions. So llnode can't iterate through them. While again possible in llnode, this feature is currently blocked by https://codereview.chromium.org/1437133006/ , and I am not sure if there will be any resolution there. Need to find a better way to get this introspection, possibly detaching postmortem from v8 project and putting it into node.js. About other features from mdb_v8. Is there anything that you are interested in? From a quick look it seems that most of the commands are already there (if not all of them), just under different names. |
Oh, and regarding post mortem working group. When is the next meeting? |
We haven't set one up yet, but I think we should file an issue in that group to set one up, since this is something we should all sync up on. The commands we use quite often are listed on this slide: http://www.slideshare.net/yunongx/debugging-node-in-prod/57 I think the most important, obviously out of all these would be some facility to walk and query all objects on the heap -- and something we should chat about at the WG meeting. |
Ok, so here is a map:
|
Cool! @indutny I created an issue here: nodejs/post-mortem#12 to kick start a new post mortem WG meeting. |
👍 @indutny I really like the effort and I am actually using it aside of mdb. @yunong I think the most used command is actually ::findjsobjects -p "name" ;-) |
Just pushed aliases for these commands. |
👍 |
@hhellyer hello! I just wanted to ask you if you are still interested in continuing your efforts? It looks like I may have some spare cycles for this, and could do something based on your approach, unless you feel like you want to do it. Thanks! |
@indutny - I am definitely still interested and working on it. I looked into whether it would be possible to get memory regions out of lldb to fix problem with being unable to walk memory regions to remove the need to run pre-processing scripts and the lldb community was really helpful, I'm working on patches for that: http://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-20160523/029772.html If I can get that delivered I was planning on updating my fork so llnode can build against source from the head of the lldb development stream but anything based off my work can have the need for pre-processing removed once the new LLDB API is available. Most of my time has been spent on that lately. |
@hhellyer wooow, you rock 👍 ! Thank you for letting me know! |
I’m tidying my code that provides the ability to locate the objects on the heap and dump them with a view to making it available for you to pull (if you want to). Initially it will still be dependant on parsing the memory region data from the core dump before starting lldb. Do you want me to add the python scripts for this to those changes or shall I leave them as gists? (It looks like you might be making llnode installable as an npm in which case it might be helpful to have them inside the project.) Is python the right language for those or would it fit better with future plans if the scripts were converted to Javascript? (They’re pretty simple, it wouldn’t be much effort.) Hopefully the need to do that pre-processing will be removed but users will still be dependent on when the standard versions of lldb actually receive those changes. |
@hhellyer I think adding scripts to this repo should be the best for llnode, this way they could be kept up to date. The python script is absolutely fine, I'll either port it to JavaScript later, or to C++ to embed it into the plugin. These are my hopes too! Thank you so much for your work, and looking forward to see the patch. 👍 |
I’ve created a pull request #13 which addresses this missing functionality. |
Implemented in c517e0c |
Great work Fedor. Any idea whether it's possible within LLDB to find heap objects? Something along the lines of https://github.com/joyent/mdb_v8/blob/master/docs/usage.md#finding-javascript-objects would be extremely helpful.
Actually, now that I think about it, what about porting some of the functionality over from mdb_v8 to lldb? The code for mdb_v8 is already open source, I wonder if it would be easier to try and port that library? In any case we should talk about your work with llnode here at an upcoming nodejs post mortem working group meeting.
The text was updated successfully, but these errors were encountered: