-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
Current trace client is a simple wrapper of eval
:
eval('hunter.trace({})'.format(options))
It works for simple or medium complex situations, such as:
hunter-trace -p 34313 stdlib=False
hunter-trace -p 34313 "hunter.Q(lambda event: event.locals.get(\"msg\") == \"ha\")"
However, it comes short when import
or customization is required before hunter.trace
.
from hunter import trace, Q, Debugger
from pdb import Pdb
trace(
Q(
# show code that contains "mumbo.jumbo" on the current line
lambda event: event.locals.get("mumbo") == "jumbo",
# and it's not in Python's stdlib
stdlib=False,
# and it contains "mumbo" on the current line
source__contains="mumbo",
action=Debugger(klass=Pdb)
)
)
With due consideration of safety, it should be allowed to eval a whole snippet of codes.
Metadata
Metadata
Assignees
Labels
No labels