Skip to content

Commit 2a156f6

Browse files
committed
[Dexter] Catch value error when encountering invalid address
The DexDeclareAddress command checks the value of a variable at a certain point in the debugged program, and saves that value to be used in other commands. If the value at that point is not a valid address however, it currently causes an error in Dexter when we try to cast it - this is fixed in this patch by catching the error and leaving the address value unresolved. Differential Revision: https://reviews.llvm.org/D127101
1 parent f0d2a55 commit 2a156f6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

cross-project-tests/debuginfo-tests/dexter/dex/command/commands/DexDeclareAddress.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ def eval(self, step_collection):
5151
try:
5252
watch = step.program_state.frames[0].watches[self.expression]
5353
except KeyError:
54-
pass
55-
else:
54+
continue
55+
try:
5656
hex_val = int(watch.value, 16)
57-
self.address_resolutions[self.get_address_name()] = hex_val
58-
break
57+
except ValueError:
58+
hex_val = None
59+
self.address_resolutions[self.get_address_name()] = hex_val
60+
break

0 commit comments

Comments
 (0)