about summary refs log tree commit diff stats
path: root/example/ida/depgraph.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2016-03-22 08:21:43 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2016-03-22 15:08:23 +0100
commitae22a569d4da74d58bbd26bb254086b486a7a69a (patch)
tree1ea7d5dc86fe01baaac265930ee381a81a965e95 /example/ida/depgraph.py
parent4f3f933654de1ccbf88cdcfe494b03f1ae394a17 (diff)
downloadmiasm-ae22a569d4da74d58bbd26bb254086b486a7a69a.tar.gz
miasm-ae22a569d4da74d58bbd26bb254086b486a7a69a.zip
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):