Debugger[CDB]: Refactor breakpoint handling.

Add a command to list breakpoints enabling id access.
Implemented breakpoint handling similar to gdb using breakpoint
ids (no longer delete and re-set all breakpoints on a change).
Save the module that is reported back in the session so that
it can be re-used for the next start. Keep a per-debugger-session
cache of fileName->Module for adding breakpoints to accelerate
setting breakpoints in the same file.
Polish the breakpoint tooltip.
This commit is contained in:
Friedemann Kleint
2011-02-03 16:26:23 +01:00
parent d5a33d2860
commit 91ead6c818
12 changed files with 327 additions and 142 deletions

View File

@@ -107,16 +107,14 @@ STDMETHODIMP EventCallback::Breakpoint(THIS_ __in PDEBUG_BREAKPOINT b)
typedef ExtensionContext::StopReasonMap StopReasonMap;
typedef ExtensionContext::StopReasonMap::value_type StopReasonMapValue;
ULONG id = 0;
ULONG uId = 0;
ULONG64 address = 0;
b->GetId(&id);
b->GetOffset(&address);
StopReasonMap stopReason;
stopReason.insert(StopReasonMapValue(std::string("breakpointId"), toString(id)));
if (address)
if (SUCCEEDED(b->GetId(&uId)))
stopReason.insert(StopReasonMapValue(std::string("breakpointId"), toString(uId)));
if (SUCCEEDED(b->GetOffset(&address)))
stopReason.insert(StopReasonMapValue(std::string("breakpointAddress"), toString(address)));
ExtensionContext::instance().setStopReason(stopReason, "breakpoint");
ExtensionContext::instance().setStopReason(stopReason, ExtensionContext::breakPointStopReasonC);
return m_wrapped ? m_wrapped->Breakpoint(b) : S_OK;
}
@@ -172,7 +170,7 @@ STDMETHODIMP EventCallback::Exception(
std::ostringstream str;
formatGdbmiHash(str, parameters);
ExtensionContext::instance().setStopReason(parameters, ExtensionContext::breakPointStopReasonC);
ExtensionContext::instance().setStopReason(parameters, "exception");
ExtensionContext::instance().report('E', 0, 0, "exception", "%s", str.str().c_str());
return m_wrapped ? m_wrapped->Exception(Ex, FirstChance) : S_OK;
}