forked from qt-creator/qt-creator
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: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user