Debugger[New CDB]:Introduce watches infrastructure.

- Move the 'current module' into the Node
- Split symbol group hierarchy into LocalsSymbolGroup
  tied to frame/thread and a separate, scopeless
  WatchesSymbolGroup
- Add infrastructure for removing symbols from a SymbolGroup,
  doing the index bookkeeping.
- Add method to synchronize watches to  WatchesSymbolGroup
  (iname/name map).
- Introduce watches commands for adding and dumping.
- Extend locals command to get watches as well.
- Add a dummy 'ErrorSymbolGroupNode' to use in case
  insertion fails.
This commit is contained in:
Friedemann Kleint
2011-01-14 16:50:31 +01:00
parent 7968853f1a
commit 3a87af8ada
13 changed files with 944 additions and 251 deletions

View File

@@ -189,6 +189,7 @@ void ExtensionContext::notifyState(ULONG Notify)
case DEBUG_NOTIFY_SESSION_INACTIVE:
report('E', 0, 0, "session_inactive", "%u", ex);
discardSymbolGroup();
discardWatchesSymbolGroup();
// We lost the debuggee, at this point restore output.
if (ex & DEBUG_STATUS_NO_DEBUGGEE)
unhookCallbacks();
@@ -196,11 +197,11 @@ void ExtensionContext::notifyState(ULONG Notify)
}
}
SymbolGroup *ExtensionContext::symbolGroup(CIDebugSymbols *symbols, ULONG threadId, int frame, std::string *errorMessage)
LocalsSymbolGroup *ExtensionContext::symbolGroup(CIDebugSymbols *symbols, ULONG threadId, int frame, std::string *errorMessage)
{
if (m_symbolGroup.get() && m_symbolGroup->frame() == frame && m_symbolGroup->threadId() == threadId)
return m_symbolGroup.get();
SymbolGroup *newSg = SymbolGroup::create(m_control.data(), symbols, threadId, frame, errorMessage);
LocalsSymbolGroup *newSg = LocalsSymbolGroup::create(m_control.data(), symbols, threadId, frame, errorMessage);
if (!newSg)
return 0;
m_symbolGroup.reset(newSg);
@@ -214,12 +215,36 @@ int ExtensionContext::symbolGroupFrame() const
return -1;
}
WatchesSymbolGroup *ExtensionContext::watchesSymbolGroup() const
{
if (m_watchesSymbolGroup.get())
return m_watchesSymbolGroup.get();
return 0;
}
WatchesSymbolGroup *ExtensionContext::watchesSymbolGroup(CIDebugSymbols *symbols, std::string *errorMessage)
{
if (m_watchesSymbolGroup.get())
return m_watchesSymbolGroup.get();
WatchesSymbolGroup *newSg = WatchesSymbolGroup::create(symbols, errorMessage);
if (!newSg)
return 0;
m_watchesSymbolGroup.reset(newSg);
return newSg;
}
void ExtensionContext::discardSymbolGroup()
{
if (m_symbolGroup.get())
m_symbolGroup.reset();
}
void ExtensionContext::discardWatchesSymbolGroup()
{
if (m_watchesSymbolGroup.get())
m_watchesSymbolGroup.reset();
}
bool ExtensionContext::report(char code, int token, int remainingChunks, const char *serviceName, PCSTR Format, ...)
{
if (!isInitialized())