fix trace-saving behavior (#454)
This commit is contained in:
parent
09bb702fac
commit
7bb64fe26e
@ -499,9 +499,9 @@ class ManticoreOutput(object):
|
|||||||
|
|
||||||
def save_trace(self, state):
|
def save_trace(self, state):
|
||||||
with self._named_stream('trace') as f:
|
with self._named_stream('trace') as f:
|
||||||
if 'visited' not in state.context:
|
if 'trace' not in state.context:
|
||||||
return
|
return
|
||||||
for pc in state.context['visited']:
|
for pc in state.context['trace']:
|
||||||
f.write('0x{:08x}\n'.format(pc))
|
f.write('0x{:08x}\n'.format(pc))
|
||||||
|
|
||||||
def save_constraints(self, state):
|
def save_constraints(self, state):
|
||||||
|
|||||||
@ -557,6 +557,7 @@ class Manticore(object):
|
|||||||
def _execute_instruction_callback(self, state, instruction):
|
def _execute_instruction_callback(self, state, instruction):
|
||||||
address = state.cpu.PC
|
address = state.cpu.PC
|
||||||
if not issymbolic(address):
|
if not issymbolic(address):
|
||||||
|
state.context.setdefault('trace', list()).append(address)
|
||||||
state.context.setdefault('visited_since_last_fork', set()).add(address)
|
state.context.setdefault('visited_since_last_fork', set()).add(address)
|
||||||
state.context.setdefault('visited', set()).add(address)
|
state.context.setdefault('visited', set()).add(address)
|
||||||
count = state.context.get('instructions_count', 0)
|
count = state.context.get('instructions_count', 0)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user