Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
How do you get a thread that has NO frame 0? That seems weird, we always have a register context to make frame 0...
Anyway, if you're going to do this, add it to the "thread == NULL" checks earlier on in the function so we can get out of the command with an appropriate error message. If we don't have a frame 0 we probably don't have registers so I'm not really sure how we're going to do any kind of stepping...
Jim
This is a patch that I've been keeping in my branches for a while. I
hit a null pointer dereference there. Looks like Ed had the same
issue. I'll move the check to the beginning of the function as you
suggested though.
I encountered an issue like this early on while bringing up a new target (FreeBSD/mips64 I think), while the work was incomplete. Of course once I finished we always have frame 0, which is why I didn't commit it at the time.
But it (or, perhaps just an assert) presumably will be handy when someone else goes down the same path.
Not worth changing the patch but fwiw you could have added eFlagRequiresFrame to the CommandObjectParsed flags for this command to do the same thing. My main reaction echoes Jim's - I don't know what it means to have a thread and no frame 0. But given that two lldb devs have hit it, I guess early in the startup of a new platform you can get hit this.
Yes, I think there are a lot of places around in lldb where we assume that if you have a valid thread you have a valid frame 0. You're not going to get very far if you don't get that right.
Jim