about summary refs log tree commit diff stats
path: root/example/ida/depgraph.py
diff options
context:
space:
mode:
authorCamille Mougey <commial@gmail.com>2016-03-22 16:05:33 +0100
committerCamille Mougey <commial@gmail.com>2016-03-22 16:05:33 +0100
commita004a1ee4f7c112d525e876447fbc1b6b3ddbd82 (patch)
tree1ea7d5dc86fe01baaac265930ee381a81a965e95 /example/ida/depgraph.py
parent4f3f933654de1ccbf88cdcfe494b03f1ae394a17 (diff)
parentae22a569d4da74d58bbd26bb254086b486a7a69a (diff)
downloadmiasm-a004a1ee4f7c112d525e876447fbc1b6b3ddbd82.tar.gz
miasm-a004a1ee4f7c112d525e876447fbc1b6b3ddbd82.zip
Merge pull request #341 from serpilliere/dg_track_reg_lower_case
Example/Depgraph: allow lower/upper register tracking
Diffstat (limited to 'example/ida/depgraph.py')
-rw-r--r--example/ida/depgraph.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/example/ida/depgraph.py b/example/ida/depgraph.py
index 1784b4e4..eb663986 100644
--- a/example/ida/depgraph.py
+++ b/example/ida/depgraph.py
@@ -92,7 +92,10 @@ Method to use:
     @property
     def elements(self):
         value = self.cbReg.value
-        return set([ir_arch.arch.regs.all_regs_ids_byname[value]])
+        reg = ir_arch.arch.regs.all_regs_ids_byname.get(value, None)
+        if reg is None:
+            raise ValueError("Unknown element '%s'!" % value)
+        return set([reg])
 
     @property
     def depgraph(self):