about summary refs log tree commit diff stats
path: root/example/expression/expr_c.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2017-08-06 00:46:32 +0200
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2017-08-08 09:25:56 +0200
commit4b200beb1bda68ee94844a81bd9d618da634f8e9 (patch)
tree4f37057224ba4a26108a699a43bb740adb072571 /example/expression/expr_c.py
parent9ada9bd6b907d47b5819a0f96d386578a9da91a1 (diff)
downloadmiasm-4b200beb1bda68ee94844a81bd9d618da634f8e9.tar.gz
miasm-4b200beb1bda68ee94844a81bd9d618da634f8e9.zip
Example: update api
Diffstat (limited to 'example/expression/expr_c.py')
-rw-r--r--example/expression/expr_c.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/example/expression/expr_c.py b/example/expression/expr_c.py
index 7adc7b50..ca92153a 100644
--- a/example/expression/expr_c.py
+++ b/example/expression/expr_c.py
@@ -41,9 +41,8 @@ types_mngr = CTypesManagerNotPacked(types_ast, base_types)
 ptr_rectangle = types_mngr.get_objc(CTypePtr(CTypeStruct('rectangle')))
 
 ptr = ExprId('ptr', 64)
-expr_types = {ptr.name: ptr_rectangle}
-
-mychandler = CHandler(types_mngr, expr_types)
+c_context = {ptr.name: ptr_rectangle}
+mychandler = CHandler(types_mngr, {})
 
 # Parse some C accesses
 c_acceses = ["ptr->width",
@@ -55,8 +54,8 @@ c_acceses = ["ptr->width",
             ]
 
 for c_str in c_acceses:
-    expr = mychandler.c_to_expr(c_str)
-    c_type = mychandler.c_to_type(c_str)
+    expr = mychandler.c_to_expr(c_str, c_context)
+    c_type = mychandler.c_to_type(c_str, c_context)
     print 'C access:', c_str
     print '\tExpr:', expr
     print '\tType:', c_type