[PATCH] D127101: [Dexter] Catch value error when encountering invalid address

Stephen Tozer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 6 04:28:56 PDT 2022


StephenTozer created this revision.
StephenTozer added reviewers: jmorse, Orlando.
StephenTozer added a project: debug-info.
Herald added a project: All.
StephenTozer requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127101

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


Index: cross-project-tests/debuginfo-tests/dexter/dex/command/commands/DexDeclareAddress.py
===================================================================
--- cross-project-tests/debuginfo-tests/dexter/dex/command/commands/DexDeclareAddress.py
+++ cross-project-tests/debuginfo-tests/dexter/dex/command/commands/DexDeclareAddress.py
@@ -53,6 +53,9 @@
                 except KeyError:
                     pass
                 else:
-                    hex_val = int(watch.value, 16)
+                    try:
+                        hex_val = int(watch.value, 16)
+                    except ValueError:
+                        hex_val = None
                     self.address_resolutions[self.get_address_name()] = hex_val
                     break


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127101.434428.patch
Type: text/x-patch
Size: 771 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220606/19ae08a6/attachment.bin>


More information about the llvm-commits mailing list