-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[Dexter] Add DexStepFunction and DexContinue skeletons #152720
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
Conversation
✅ With the latest revision this PR passed the Python code formatter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many small comments, but generally looks good.
cross-project-tests/debuginfo-tests/dexter/dex/command/commands/DexContinue.py
Outdated
Show resolved
Hide resolved
cross-project-tests/debuginfo-tests/dexter/dex/command/commands/DexContinue.py
Outdated
Show resolved
Hide resolved
cross-project-tests/debuginfo-tests/dexter/dex/command/commands/DexStepFunction.py
Outdated
Show resolved
Hide resolved
def __init__(self, *args, **kwargs): | ||
if len(args) < 1: | ||
raise TypeError("expected 1 positional argument") | ||
self.expression = str(args[0]) # Function name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe name this self.function
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there was a reason I used self.expression. But I don't recall why (it was a while ago, while I was making the stepping-graphs for key instructions. It could just have easily been a mistaken assumption). I'm happy to change it to self.function and if we run into issues (perhaps with printing?) we can reassess, rather than have unnecessarily cryptic code.
self.from_line = kwargs.pop("from_line", 1) | ||
self.to_line = kwargs.pop("to_line", 999999) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do the arguments to this work? I would assume that this function would be willing to accept a on_line
argument, and I'd also assume that in the absence of any line argument ("on" or "from/to") this command is essentially meaningless, so it should be necessary to pass at least one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you feel strongly that on_line
is better than from_line
when to_line
is omitted? My preference is to keep it to just from_line
as it still makes sense to me and keeps things simpler, but I don't mind changing it if you'd prefer.
I agree that we need at least one line arg - done.
super(DexContinue, self).__init__() | ||
|
||
def eval(self): | ||
raise NotImplementedError("DexContinue commands cannot be evaled.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, I don't know how I feel about this particular adjectivalisation, maybe we could avoid it by changing it to "Cannot eval DexContinue commands" or similar, or maybe you can just ignore this comment as being a matter of taste!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you, but I copied this from other existing commands, so I'm inclined to keep it for uniformity.
FIXME: hit_count should probably be inverted, like `DexLimitSteps`, to trigger | ||
AFTER that many hits? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest creating two separate words for it. In debugger parlance, I think "hit_count=n" means after n hits, maybe we could replace the alternative form with "repeat_count"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DexFinishTest works in the hit_count sense, but other commands work in the repeat_count sense. Could we land this as-is and separately fix this inconsistency across all the commands?
47f3267
to
6fe4940
Compare
f42e8d1
to
3c16976
Compare
6fe4940
to
d35acc5
Compare
3c16976
to
83608ac
Compare
No description provided.