Commit ea8665c2 authored by David Schulz's avatar David Schulz

CdbExtension: Make sure watches group is initialized.

This fixes a crash that occurs when a debugger was started
without an active watch and a watch were added afterwards.

Change-Id: I0219a750bae7b433240b22f99b2e8fd8655ca331
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 2714a7e9
......@@ -513,14 +513,16 @@ static std::string commandLocals(ExtensionCommandContext &commandExtCtx,PCSTR ar
if (watchSynchronization) {
watchesSymbolGroup = 0;
extCtx.discardWatchesSymbolGroup();
if (!watcherInameExpressionMap.empty()) {
// Force group into existence
watchesSymbolGroup = extCtx.watchesSymbolGroup(commandExtCtx.symbols(), errorMessage);
if (!watchesSymbolGroup || !watchesSymbolGroup->synchronize(commandExtCtx.symbols(),
watcherInameExpressionMap,
errorMessage)) {
return std::string();
}
}
if (watchesSymbolGroup == 0
&& (!watcherInameExpressionMap.empty() || WatchesSymbolGroup::isWatchIname(iname))) {
// Force group into existence
watchesSymbolGroup = extCtx.watchesSymbolGroup(commandExtCtx.symbols(), errorMessage);
if (!watchesSymbolGroup || !watchesSymbolGroup->synchronize(commandExtCtx.symbols(),
watcherInameExpressionMap,
errorMessage)) {
return std::string();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment