Clean up output (#150)

* Quiet down some error messages
* Address comments
This commit is contained in:
Yan
2017-04-19 14:28:46 -04:00
committed by GitHub
parent 1171b3a37f
commit 9ca1f4a43a
3 changed files with 11 additions and 9 deletions
+3 -2
View File
@@ -396,8 +396,9 @@ class Cpu(object):
raise InvalidPCException(self.PC)
if not self.memory.access_ok(slice(pc, pc+instruction.size), 'x'):
logger.info("Trying to execute instructions from not executable memory")
logger.info("Trying to execute instructions from non-executable memory")
raise InvalidPCException(self.PC)
instruction.operands = self._wrap_operands(instruction.operands)
self._instruction_cache[pc] = instruction
@@ -428,7 +429,7 @@ class Cpu(object):
def fallback_to_emulate(*operands):
text_bytes = ' '.join('%02x'%x for x in instruction.bytes)
logger.info("UNIMPLEMENTED INSTRUCTION: 0x%016x:\t%s\t%s\t%s",
logger.info("Unimplemented instruction: 0x%016x:\t%s\t%s\t%s",
instruction.address, text_bytes, instruction.mnemonic,
instruction.op_str)
self.emulate(instruction)
+3 -2
View File
@@ -5262,8 +5262,9 @@ class X86Cpu(Cpu):
elif dest.size == 64 and src.size == 128:
dest.write(Operators.EXTRACT(src.read(), 0, dest.size))
else:
logger.error("INVALID SIZES IN MOVQ!")
raise Exception("INVALID SIZES IN MOVQ!")
msg = 'Invalid size in MOVQ'
logger.error(msg)
raise Exception(msg)
@instruction
def MOVSD(cpu, dest, src):
+5 -5
View File
@@ -253,7 +253,7 @@ class Executor(object):
# there recursion limit exceeded problem,
# try a slower, iterative solution
from ..utils import iterpickle
logger.info("WARNING: using iterpickle to dump state")
logger.warning("Using iterpickle to dump state")
f.write(iterpickle.dumps(state, 2))
filesize = f.tell()
@@ -383,7 +383,7 @@ class Executor(object):
if policy == 'bucket':
logger.info("Metric %r", 'bucket'*10 )
logger.info("Metric: bucket")
for st_name, st_stat in sorted( self._states.items(), key = lambda (st_name,st_stat): metric(st_stat) ):
brs = st_stat['branches']
@@ -801,8 +801,8 @@ class Executor(object):
break
except SyscallNotImplemented as e:
logger.error("SYSCALL NOT IMPLEMENTED, PLEASE IMPLEMENT\n%s", str(e))
self.generate_testcase(current_state, "UNIMPLEMENTED syscall "+str(e))
logger.error("Syscall not implemented: %s", str(e))
self.generate_testcase(current_state, "Unimplemented syscall "+str(e))
current_state = None
except AssertionError as e:
@@ -823,7 +823,7 @@ class Executor(object):
except Exception as e:
import traceback
trace = traceback.format_exc()
logger.error("THIS SHOULD NOT REACHABLE! Exception in user code: %s\n%s", str(e), trace)
logger.error("Exception: %s\n%s", str(e), trace)
for log in trace.splitlines():
logger.error(log)
current_state = None