MCPcopy Create free account
hub / github.com/OpenCppCoverage/OpenCppCoverage / AdjustEipAfterBreakPointRemoval

Method AdjustEipAfterBreakPointRemoval

CppCoverage/BreakPoint.cpp:94–108  ·  view source on GitHub ↗

-------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

92
93 //-------------------------------------------------------------------------
94 void BreakPoint::AdjustEipAfterBreakPointRemoval(HANDLE hThread) const
95 {
96 CONTEXT lcContext;
97 lcContext.ContextFlags = CONTEXT_ALL;
98 if (!GetThreadContext(hThread, &lcContext))
99 THROW_LAST_ERROR("Error in GetThreadContext", GetLastError());
100
101#ifdef _WIN64
102 --lcContext.Rip; // Move back one byte
103#else
104 --lcContext.Eip; // Move back one byte
105#endif
106 if (!SetThreadContext(hThread, &lcContext))
107 THROW_LAST_ERROR("Error in SetThreadContext", GetLastError());
108 }
109}

Callers 1

OnBreakPointMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected