Closed kastiglione closed 6 years ago
The change you'll want to review are 2e76bf7. As for testing these changes, got any ideas…?
Hey @kastiglione, thanks for opening this PR up. I totally agree with you on we shouldn't use the globals especially if others are viewing this as a reference for how to work w/ the lldb module. Think I did that just out of laziness since the SBTarget rarely ever changes (unlike SBFrame or SBThread...) Anyways, I'll merge that in after work
As for regression testing and all that, we definitely ain't up to Chisel's standards yet so testing just encompasses me using these scripts day in and day out.
Glad to see you're still keeping up w/ all this stuff even at the new jerb :]
reference for how to work w/ the lldb module
This was one of the motivators for me. I'll be doing similar changes to chisel once my CLA is approved.
Damn. You even went through the dclass code. 👏 I don't ever want to touch that again
This change adds the
exe_ctx
parameter to each command. This parameter is aSBExecutionContext
which provides direct access to thetarget
,frame
,process
, andthread
.In particular, this reduces the use of
ds.getTarget()
, which relied on the globallldb.target
. The lldb documentation (see "EMBEDDED PYTHON INTERPRETER") states this about the globals:For information about the
exe_ctx
parameter, see "CREATE A NEW LLDB COMMAND USING A PYTHON FUNCTION" at https://lldb.llvm.org/python-reference.html