mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 03:23:23 +08:00
[0.1.x] ~ability to return "None" from bp-handler
git-svn-id: https://pykd.svn.codeplex.com/svn@74730 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
4033f95230
commit
b2d78a7962
@ -91,14 +91,28 @@ HRESULT InternalDbgEventHandler::Breakpoint(IDebugBreakpoint *bp)
|
||||
BpCallbackMapIml::iterator it = m_bpCallbacks.m_map.find(Id);
|
||||
if (it != m_bpCallbacks.m_map.end())
|
||||
{
|
||||
try {
|
||||
python::object resObj;
|
||||
{
|
||||
PyThread_StateSave pyThreadSave( m_parentClient->getThreadState() );
|
||||
hres = python::extract<HRESULT>( it->second(Id) );
|
||||
return hres;
|
||||
}
|
||||
catch (const python::error_already_set &) {
|
||||
// TODO: some logging, alerting...
|
||||
try {
|
||||
resObj = it->second(Id);
|
||||
|
||||
python::extract<HRESULT> getRetCode( resObj );
|
||||
if (getRetCode.check())
|
||||
return getRetCode;
|
||||
}
|
||||
catch (const python::error_already_set &) {
|
||||
// TODO: some logging, alerting...
|
||||
return DEBUG_STATUS_BREAK;
|
||||
}
|
||||
}
|
||||
|
||||
if (resObj.is_none())
|
||||
return DEBUG_STATUS_NO_CHANGE;
|
||||
|
||||
// TODO: python code return invalid value
|
||||
// some logging, alerting...
|
||||
return DEBUG_STATUS_BREAK;
|
||||
}
|
||||
}
|
||||
return DEBUG_STATUS_NO_CHANGE;
|
||||
|
@ -54,7 +54,6 @@ bpHandlerTestResult = BpHandlerTestResult()
|
||||
def codeBpHandler(bpId):
|
||||
""" Handler of software breakpoint """
|
||||
bpHandlerTestResult.wasCodeBp = bpId
|
||||
return pykd.DEBUG_STATUS_NO_CHANGE
|
||||
|
||||
def dataBpHandler(bpId):
|
||||
""" Handler of hardware breakpoint """
|
||||
@ -85,6 +84,8 @@ class EhExceptionBreakpointTest(unittest.TestCase):
|
||||
# breakpoint so hardware breakpoints cannot be set.
|
||||
# Go to the executable's entry point and set it then.
|
||||
|
||||
# raw_input("Press <ENTER>....")
|
||||
|
||||
breakExceptionHandler = BreakExceptionHandler( testClient )
|
||||
while not breakExceptionHandler.wasSecondChance:
|
||||
testClient.go()
|
||||
|
Loading…
Reference in New Issue
Block a user