[DexTer] Add step.UNKNOWN check for NoneType line numbers.

Summary: It's possible for an instance of the visual studio debugger
to return a NoneType line number location when stepping during a
debugging session.

This patches teaches DexTer how to handle this particular case without
crashing out.

Reviewers: Orlando

Differential revision: https://reviews.llvm.org/D75992
This commit is contained in:
Tom Weaver 2020-03-16 16:38:41 +00:00
parent 07a41544fd
commit 09f4bdc03f
1 changed files with 4 additions and 0 deletions

View File

@ -102,6 +102,10 @@ class DextIR:
frame_step = self._get_prev_step_in_this_frame(step)
prev_step = frame_step if frame_step is not None else prev_step
# If we're missing line numbers to compare then the step kind has to be UNKNOWN.
if prev_step.current_location.lineno is None or step.current_location.lineno is None:
return StepKind.UNKNOWN
# We're in the same func as prev step, check lineo.
if prev_step.current_location.lineno > step.current_location.lineno:
return StepKind.VERTICAL_BACKWARD