diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-05-05 22:59:20 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-05-09 12:27:17 +0200 |
| commit | db4fd7f58d6a4ed87fc7d6f28c7c2af31e61fb65 (patch) | |
| tree | d9b3e4a9889c3ee02f57ad8b6f346ea19cab277a /miasm2/core/cpu.py | |
| parent | 8f5a42ae2b659f10bdf52adbd8e382e0784f74a1 (diff) | |
| download | miasm-db4fd7f58d6a4ed87fc7d6f28c7c2af31e61fb65.tar.gz miasm-db4fd7f58d6a4ed87fc7d6f28c7c2af31e61fb65.zip | |
Cpu: fix fromstring arg name
Diffstat (limited to 'miasm2/core/cpu.py')
| -rw-r--r-- | miasm2/core/cpu.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/miasm2/core/cpu.py b/miasm2/core/cpu.py index 57057a85..061752f8 100644 --- a/miasm2/core/cpu.py +++ b/miasm2/core/cpu.py @@ -656,13 +656,13 @@ class bs_swapargs(bs_divert): class m_arg(object): - def fromstring(self, s, parser_result=None): + def fromstring(self, text, parser_result=None): if parser_result: e, start, stop = parser_result[self.parser] self.expr = e return start, stop try: - v, start, stop = self.parser.scanString(s).next() + v, start, stop = self.parser.scanString(text).next() except StopIteration: return None, None self.expr = v[0] @@ -688,13 +688,13 @@ class reg_noarg(object): reg_info = None parser = None - def fromstring(self, s, parser_result=None): + def fromstring(self, text, parser_result=None): if parser_result: e, start, stop = parser_result[self.parser] self.expr = e return start, stop try: - v, start, stop = self.parser.scanString(s).next() + v, start, stop = self.parser.scanString(text).next() except StopIteration: return None, None self.expr = v[0] @@ -1252,11 +1252,11 @@ class cls_mn(object): return out[0] @classmethod - def fromstring(cls, s, mode = None): + def fromstring(cls, text, mode = None): global total_scans - name = re.search('(\S+)', s).groups() + name = re.search('(\S+)', text).groups() if not name: - raise ValueError('cannot find name', s) + raise ValueError('cannot find name', text) name = name[0] if not name in cls.all_mn_name: @@ -1269,7 +1269,7 @@ class cls_mn(object): for cc in clist: for c in cls.get_cls_instance(cc, mode): args_expr = [] - args_str = s[len(name):].strip(' ') + args_str = text[len(name):].strip(' ') start = 0 cannot_parse = False @@ -1316,7 +1316,7 @@ class cls_mn(object): break if len(out) == 0: - raise ValueError('cannot fromstring %r' % s) + raise ValueError('cannot fromstring %r' % text) if len(out) != 1: log.debug('fromstring multiple args ret default') c = out[0] @@ -1532,12 +1532,12 @@ class imm_noarg(object): return None return v - def fromstring(self, s, parser_result=None): + def fromstring(self, text, parser_result=None): if parser_result: e, start, stop = parser_result[self.parser] else: try: - e, start, stop = self.parser.scanString(s).next() + e, start, stop = self.parser.scanString(text).next() except StopIteration: return None, None if e is None: @@ -1551,7 +1551,7 @@ class imm_noarg(object): else: raise TypeError('zarb expr') if self.expr is None: - log.debug('cannot fromstring int %r', s) + log.debug('cannot fromstring int %r', text) return None, None return start, stop |