about summary refs log tree commit diff stats
path: root/miasm2/arch/ppc
diff options
context:
space:
mode:
Diffstat (limited to 'miasm2/arch/ppc')
-rw-r--r--miasm2/arch/ppc/arch.py20
-rw-r--r--miasm2/arch/ppc/jit.py4
-rw-r--r--miasm2/arch/ppc/sem.py12
3 files changed, 18 insertions, 18 deletions
diff --git a/miasm2/arch/ppc/arch.py b/miasm2/arch/ppc/arch.py
index 5336ea21..94b2b903 100644
--- a/miasm2/arch/ppc/arch.py
+++ b/miasm2/arch/ppc/arch.py
@@ -34,23 +34,23 @@ deref = deref_reg | deref_reg_disp
 
 
 class ppc_arg(m_arg):
-    def asm_ast_to_expr(self, arg, symbol_pool):
+    def asm_ast_to_expr(self, arg, loc_db):
         if isinstance(arg, AstId):
             if isinstance(arg.name, ExprId):
                 return arg.name
             if arg.name in gpregs.str:
                 return None
-            loc_key = symbol_pool.getby_name_create(arg.name)
+            loc_key = loc_db.getby_name_create(arg.name)
             return ExprLoc(loc_key, 32)
         if isinstance(arg, AstOp):
-            args = [self.asm_ast_to_expr(tmp, symbol_pool) for tmp in arg.args]
+            args = [self.asm_ast_to_expr(tmp, loc_db) for tmp in arg.args]
             if None in args:
                 return None
             return ExprOp(arg.op, *args)
         if isinstance(arg, AstInt):
             return ExprInt(arg.value, 32)
         if isinstance(arg, AstMem):
-            ptr = self.asm_ast_to_expr(arg.ptr, symbol_pool)
+            ptr = self.asm_ast_to_expr(arg.ptr, loc_db)
             if ptr is None:
                 return None
             return ExprMem(ptr, arg.size)
@@ -73,7 +73,7 @@ class instruction_ppc(instruction):
         super(instruction_ppc, self).__init__(*args, **kargs)
 
     @staticmethod
-    def arg2str(e, pos = None, symbol_pool=None):
+    def arg2str(e, pos = None, loc_db=None):
         if isinstance(e, ExprId) or isinstance(e, ExprInt):
             return str(e)
         elif isinstance(e, ExprMem):
@@ -109,7 +109,7 @@ class instruction_ppc(instruction):
                 name[-3:] != 'CTR' and
                 name[-4:] != 'CTRL')
 
-    def dstflow2label(self, symbol_pool):
+    def dstflow2label(self, loc_db):
         name = self.name
         if name[-1] == '+' or name[-1] == '-':
             name = name[:-1]
@@ -131,7 +131,7 @@ class instruction_ppc(instruction):
                 ad = e.arg + self.offset
             else:
                 ad = e.arg
-            loc_key = symbol_pool.getby_offset_create(ad)
+            loc_key = loc_db.getby_offset_create(ad)
             s = ExprLoc(loc_key, e.size)
             self.args[address_index] = s
 
@@ -144,7 +144,7 @@ class instruction_ppc(instruction):
             name = name[0:-1]
         return name[0] == 'B' and (name[-1] == 'L' or name[-2:-1] == 'LA')
 
-    def getdstflow(self, symbol_pool):
+    def getdstflow(self, loc_db):
         if 'LR' in self.name:
             return [ LR ]
         elif 'CTR' in self.name:
@@ -163,7 +163,7 @@ class instruction_ppc(instruction):
         ret = ret or self.is_subcall()
         return ret
 
-    def get_symbol_size(self, symbol, symbol_pool):
+    def get_symbol_size(self, symbol, loc_db):
         return 32
 
     def fixDstOffset(self):
@@ -279,7 +279,7 @@ class mn_ppc(cls_mn):
         else:
             raise NotImplementedError("bad attrib")
 
-    def get_symbol_size(self, symbol, symbol_pool, mode):
+    def get_symbol_size(self, symbol, loc_db, mode):
         return 32
 
 
diff --git a/miasm2/arch/ppc/jit.py b/miasm2/arch/ppc/jit.py
index e79faabd..14c203a9 100644
--- a/miasm2/arch/ppc/jit.py
+++ b/miasm2/arch/ppc/jit.py
@@ -1,5 +1,5 @@
 from miasm2.jitter.jitload import Jitter, named_arguments
-from miasm2.core import asmblock
+from miasm2.core.locationdb import LocationDB
 from miasm2.arch.ppc.sem import ir_ppc32b
 import struct
 
@@ -15,7 +15,7 @@ class jitter_ppc32b(Jitter):
     max_reg_arg = 8
 
     def __init__(self, *args, **kwargs):
-        super(jitter_ppc32b, self).__init__(ir_ppc32b(asmblock.AsmSymbolPool()),
+        super(jitter_ppc32b, self).__init__(ir_ppc32b(LocationDB()),
                                             *args, **kwargs)
         self.vm.set_big_endian()
 
diff --git a/miasm2/arch/ppc/sem.py b/miasm2/arch/ppc/sem.py
index 8ddb43ef..77e4973a 100644
--- a/miasm2/arch/ppc/sem.py
+++ b/miasm2/arch/ppc/sem.py
@@ -606,8 +606,8 @@ def mn_do_store(ir, instr, arg1, arg2, arg3=None):
             ret.append(ExprAff(arg2, address))
 
     if is_stwcx:
-        loc_do = ExprLoc(ir.symbol_pool.gen_loc_key(), ir.IRDst.size)
-        loc_dont = ExprLoc(ir.symbol_pool.gen_loc_key(), ir.IRDst.size)
+        loc_do = ExprLoc(ir.loc_db.gen_loc_key(), ir.IRDst.size)
+        loc_dont = ExprLoc(ir.loc_db.gen_loc_key(), ir.IRDst.size)
         loc_next = ExprLoc(ir.get_next_loc_key(instr), ir.IRDst.size)
         flags = [ ExprAff(CR0_LT, ExprInt(0,1)),
                   ExprAff(CR0_GT, ExprInt(0,1)),
@@ -842,8 +842,8 @@ sem_dir = {
 
 class ir_ppc32b(IntermediateRepresentation):
 
-    def __init__(self, symbol_pool=None):
-        super(ir_ppc32b, self).__init__(mn_ppc, 'b', symbol_pool)
+    def __init__(self, loc_db=None):
+        super(ir_ppc32b, self).__init__(mn_ppc, 'b', loc_db)
         self.pc = mn_ppc.getpc()
         self.sp = mn_ppc.getsp()
         self.IRDst = expr.ExprId('IRDst', 32)
@@ -916,9 +916,9 @@ class ir_ppc32b(IntermediateRepresentation):
         return instr_ir, extra_ir
 
     def get_next_instr(self, instr):
-        l = self.symbol_pool.getby_offset_create(instr.offset  + 4)
+        l = self.loc_db.getby_offset_create(instr.offset  + 4)
         return l
 
     def get_next_break_loc_key(self, instr):
-        l = self.symbol_pool.getby_offset_create(instr.offset  + 4)
+        l = self.loc_db.getby_offset_create(instr.offset  + 4)
         return l