def platformProcessEvent(self, event):
"""
Handle a mach exception message
"""
#if self.attaching:
#self.useptrace = True
#return self.handlePosixSignal(event)
#self.useptrace = False
# Some event states that need to be reset
self.softexc = False
threadid, excode, codes = event
# Set the thread that signaled.
self.setMeta('ThreadId', threadid)
self.setMeta('StoppedThreadId', threadid)
self.setMeta('MachException', event)
if excode == EXC_SOFTWARE:
self.softexc = True
assert( len(codes) == 2 )
assert( codes[0] == EXC_SOFT_SIGNAL )
sig = codes[1]
self.handlePosixSignal(sig)
elif excode == EXC_BAD_ACCESS:
print('exc_bad_access',repr([hex(x) for x in codes ]))
signo = signal.SIGSEGV
#if codes[0] == KERN_INVALID_ADDRESS:
#signo = signal.SIGBUS
self._fireSignal(signo)
elif excode == EXC_BAD_INSTRUCTION:
print('exc_bad_instruction',repr([hex(x) for x in codes ]))
self._fireSignal(signal.SIGILL)
elif excode == EXC_CRASH:
print('exc_crash')
print('Crash:',repr([hex(x) for x in codes]))
self._fireExit(0xffffffff)
elif excode == EXC_BREAKPOINT:
print('exc_breakpoint',codes)
self.handlePosixSignal(signal.SIGTRAP)
else:
print('Unprocessed Exception Type: %d' % excode)
self.fireNotifiers(vtrace.NOTIFY_SIGNAL)
return
评论列表
文章目录