mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 12:53: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,15 +91,29 @@ HRESULT InternalDbgEventHandler::Breakpoint(IDebugBreakpoint *bp)
|
|||||||
BpCallbackMapIml::iterator it = m_bpCallbacks.m_map.find(Id);
|
BpCallbackMapIml::iterator it = m_bpCallbacks.m_map.find(Id);
|
||||||
if (it != m_bpCallbacks.m_map.end())
|
if (it != m_bpCallbacks.m_map.end())
|
||||||
{
|
{
|
||||||
try {
|
python::object resObj;
|
||||||
|
{
|
||||||
PyThread_StateSave pyThreadSave( m_parentClient->getThreadState() );
|
PyThread_StateSave pyThreadSave( m_parentClient->getThreadState() );
|
||||||
hres = python::extract<HRESULT>( it->second(Id) );
|
try {
|
||||||
return hres;
|
resObj = it->second(Id);
|
||||||
|
|
||||||
|
python::extract<HRESULT> getRetCode( resObj );
|
||||||
|
if (getRetCode.check())
|
||||||
|
return getRetCode;
|
||||||
}
|
}
|
||||||
catch (const python::error_already_set &) {
|
catch (const python::error_already_set &) {
|
||||||
// TODO: some logging, alerting...
|
// 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;
|
return DEBUG_STATUS_NO_CHANGE;
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,6 @@ bpHandlerTestResult = BpHandlerTestResult()
|
|||||||
def codeBpHandler(bpId):
|
def codeBpHandler(bpId):
|
||||||
""" Handler of software breakpoint """
|
""" Handler of software breakpoint """
|
||||||
bpHandlerTestResult.wasCodeBp = bpId
|
bpHandlerTestResult.wasCodeBp = bpId
|
||||||
return pykd.DEBUG_STATUS_NO_CHANGE
|
|
||||||
|
|
||||||
def dataBpHandler(bpId):
|
def dataBpHandler(bpId):
|
||||||
""" Handler of hardware breakpoint """
|
""" Handler of hardware breakpoint """
|
||||||
@ -85,6 +84,8 @@ class EhExceptionBreakpointTest(unittest.TestCase):
|
|||||||
# breakpoint so hardware breakpoints cannot be set.
|
# breakpoint so hardware breakpoints cannot be set.
|
||||||
# Go to the executable's entry point and set it then.
|
# Go to the executable's entry point and set it then.
|
||||||
|
|
||||||
|
# raw_input("Press <ENTER>....")
|
||||||
|
|
||||||
breakExceptionHandler = BreakExceptionHandler( testClient )
|
breakExceptionHandler = BreakExceptionHandler( testClient )
|
||||||
while not breakExceptionHandler.wasSecondChance:
|
while not breakExceptionHandler.wasSecondChance:
|
||||||
testClient.go()
|
testClient.go()
|
||||||
|
Loading…
Reference in New Issue
Block a user