From 766924d740188e48264823c962b1a526a8391e77 Mon Sep 17 00:00:00 2001 From: gaa-cifasis Date: Tue, 22 Mar 2016 12:42:19 +0000 Subject: [PATCH] fix --- vdiscover/Process.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/vdiscover/Process.py b/vdiscover/Process.py index e3dfdc8..332ed53 100644 --- a/vdiscover/Process.py +++ b/vdiscover/Process.py @@ -45,7 +45,7 @@ from Alarm import alarm_handler, TimeoutEx class Process(Application): - def __init__(self, program, envs, timeout, included_mods = [], ignored_mods = [], no_stdout = True, max_events = 10000): + def __init__(self, program, envs, timeout, included_mods = [], ignored_mods = [], no_stdout = True, max_events = 320, min_events = -10*320): Application.__init__(self) # no effect @@ -64,6 +64,7 @@ def __init__(self, program, envs, timeout, included_mods = [], ignored_mods = [] self.mm = None self.timeouts = 0 self.max_events = max_events + self.min_events = min_events # Parse ELF self.elf = ELF(self.program, plt = False) @@ -157,13 +158,22 @@ def createEvents(self, signal): self.process.singleStep() self.debugger.waitProcessEvent() - n = self.nevents.get(name, 0) - self.nevents[name] = n + 1 + n = self.nevents.get((ip,name), 0) + self.nevents[(ip, name)] = n + 2 + + for ((ip_,name_),n) in self.nevents.items(): + + if n > self.min_events + 1: + self.nevents[(ip_, name_)] = n - 1 + elif n == self.min_events + 1: + self.nevents[(ip_, name_)] = self.min_events + #print "restoring!", (ip, name) + self.breakpoint(call_ip) if n < self.max_events: self.breakpoint(call_ip) #else: - #print "disabled!" + #print "disabled!", (ip, name) #print "call detected!" return [call]