Skip to content

Commit

Permalink
Make exceptBpList when common initialization in btrace mode
Browse files Browse the repository at this point in the history
Signed-off-by: Peace Lee <[email protected]>
  • Loading branch information
iipeace committed Mar 8, 2020
1 parent 1dbff57 commit a86cfe0
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions guider/guider.py
Original file line number Diff line number Diff line change
Expand Up @@ -24243,9 +24243,10 @@ def doCommonJobs(pids, procList):
SysMgr.sendSignalProcs, \
[signal.SIGCONT, [pid], False, False])

bpList.setdefault(pid, dict())
exceptBpList.setdefault(pid, dict())
targetBpList.setdefault(pid, dict())
targetBpFileList.setdefault(pid, dict())
bpList.setdefault(pid, dict())

# create object #
procObj = Debugger(pid=pid, execCmd=execCmd)
Expand All @@ -24257,12 +24258,14 @@ def doCommonJobs(pids, procList):
procObj.updateBpList()

# save per-process breakpoint info #
bpList[pid] = \
copy.deepcopy(procObj.bpList)
exceptBpList[pid] = \
copy.deepcopy(procObj.exceptBpList)
targetBpList[pid] = \
copy.deepcopy(procObj.targetBpList)
targetBpFileList[pid] = \
copy.deepcopy(procObj.targetBpFileList)
bpList[pid] = \
copy.deepcopy(procObj.bpList)

procObj.detach()
del procObj
Expand All @@ -24289,6 +24292,7 @@ def doCommonJobs(pids, procList):
lockObj = None
procList = {}
bpList = {}
exceptBpList = {}
targetBpList = {}
targetBpFileList = {}

Expand Down Expand Up @@ -24439,22 +24443,19 @@ def doCommonJobs(pids, procList):
ppid = long(SysMgr.getTgid(pid))

# set per-process convert breakpoint list #
try:
if ppid in bpList:
bpList = bpList[ppid]
except:
bpList = {}
try:
if ppid in exceptBpList:
exceptBpList = exceptBpList[ppid]
if ppid in targetBpList:
targetBpList = targetBpList[ppid]
except:
targetBpList = {}
try:
if ppid in targetBpFileList:
targetBpFileList = targetBpFileList[ppid]
except:
targetBpFileList = {}

Debugger(pid=pid, execCmd=execCmd).\
trace(mode='break', wait=wait, bpList=bpList, \
multi=multi, lock=lockObj, targetBpList=targetBpList, \
trace(mode='break', wait=wait, multi=multi, \
bpList=bpList, exceptBpList = exceptBpList, \
lock=lockObj, targetBpList=targetBpList, \
targetBpFileList=targetBpFileList)
elif mode == 'signal':
Debugger(pid=pid, execCmd=execCmd).\
Expand Down Expand Up @@ -33497,7 +33498,6 @@ def handleBreakpoint(self, printStat=False, checkArg=None):
# pick breakpoint info #
sym = self.bpList[addr]['symbol']
fname = self.bpList[addr]['filename']
cmd = self.bpList[addr]['cmd']

# update memory map and load new objects #
if self.needMapScan or \
Expand Down Expand Up @@ -34683,8 +34683,8 @@ def runEventLoop(self):


def trace(\
self, mode='syscall', wait=None, \
multi=False, lock=None, bpList={}, \
self, mode='syscall', wait=None,\
multi=False, lock=None, bpList={}, exceptBpList={},\
targetBpList={}, targetBpFileList={}):

# index variables #
Expand Down Expand Up @@ -34831,6 +34831,7 @@ def trace(\
if self.isRunning:
# register breakpoint data #
self.bpList = bpList
self.exceptBpList = exceptBpList

# check thread status #
stat = self.getStatList(status=True)
Expand Down

0 comments on commit a86cfe0

Please sign in to comment.