about summary refs log tree commit diff stats
path: root/miasm2/core
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2017-02-15 16:41:53 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2017-03-13 14:13:14 +0100
commit72d7235d59d0998bee24b3bf9b18d5501e84f085 (patch)
tree6ceb628e7b0e80f21fc2baebc7eeedb6580bd3f2 /miasm2/core
parentd0727aa74bf264580e82f37abc9833b75804daca (diff)
downloadmiasm-72d7235d59d0998bee24b3bf9b18d5501e84f085.tar.gz
miasm-72d7235d59d0998bee24b3bf9b18d5501e84f085.zip
Asmbloc: rename asm_symbol_pool to AsmSymbolPool
Diffstat (limited to 'miasm2/core')
-rw-r--r--miasm2/core/asmbloc.py13
-rw-r--r--miasm2/core/parse_asm.py8
2 files changed, 14 insertions, 7 deletions
diff --git a/miasm2/core/asmbloc.py b/miasm2/core/asmbloc.py
index 97f94821..a76ec8a6 100644
--- a/miasm2/core/asmbloc.py
+++ b/miasm2/core/asmbloc.py
@@ -306,7 +306,7 @@ class asm_block_bad(AsmBlockBad):
         super(asm_block_bad, self).__init__(label, alignment, *args, **kwargs)
 
 
-class asm_symbol_pool:
+class AsmSymbolPool(object):
 
     def __init__(self):
         self._labels = []
@@ -430,6 +430,13 @@ class asm_symbol_pool:
         return label
 
 
+class asm_symbol_pool(AsmSymbolPool):
+
+    def __init__(self):
+        warnings.warn('DEPRECATION WARNING: use "AsmSymbolPool" instead of "asm_symbol_pool"')
+        super(asm_symbol_pool, self).__init__()
+
+
 class AsmCFG(DiGraph):
 
     """Directed graph standing for a ASM Control Flow Graph with:
@@ -758,7 +765,7 @@ class AsmCFG(DiGraph):
         In order to work, they must be only one block in @self per label in
         @symbol_pool (which is true if @self come from the same disasmEngine).
 
-        @symbol_pool: asm_symbol_pool instance associated with @self'labels
+        @symbol_pool: AsmSymbolPool instance associated with @self'labels
         @dis_block_callback: (optional) if set, this callback will be called on
         new block destinations
         @kwargs: (optional) named arguments to pass to dis_block_callback
@@ -1328,7 +1335,7 @@ class disasmEngine(object):
         self.arch = arch
         self.attrib = attrib
         self.bin_stream = bin_stream
-        self.symbol_pool = asm_symbol_pool()
+        self.symbol_pool = AsmSymbolPool()
         self.job_done = set()
 
         # Setup options
diff --git a/miasm2/core/parse_asm.py b/miasm2/core/parse_asm.py
index e51a2412..cda330fc 100644
--- a/miasm2/core/parse_asm.py
+++ b/miasm2/core/parse_asm.py
@@ -61,7 +61,7 @@ class DirectiveDontSplit(Directive):
 
 def guess_next_new_label(symbol_pool):
     """Generate a new label
-    @symbol_pool: the asm_symbol_pool instance"""
+    @symbol_pool: the AsmSymbolPool instance"""
     i = 0
     gen_name = "loc_%.8X"
     while True:
@@ -103,18 +103,18 @@ STATE_IN_BLOC = 1
 
 def parse_txt(mnemo, attrib, txt, symbol_pool=None):
     """Parse an assembly listing. Returns a couple (blocks, symbol_pool), where
-    blocks is a list of asm_bloc and symbol_pool the associated asm_symbol_pool
+    blocks is a list of asm_bloc and symbol_pool the associated AsmSymbolPool
 
     @mnemo: architecture used
     @attrib: architecture attribute
     @txt: assembly listing
-    @symbol_pool: (optional) the asm_symbol_pool instance used to handle labels
+    @symbol_pool: (optional) the AsmSymbolPool instance used to handle labels
     of the listing
 
     """
 
     if symbol_pool is None:
-        symbol_pool = asmbloc.asm_symbol_pool()
+        symbol_pool = asmbloc.AsmSymbolPool()
 
     C_NEXT = asmbloc.asm_constraint.c_next
     C_TO = asmbloc.asm_constraint.c_to