forked from qt-creator/qt-creator
Debugger: Fix dereference function of the cdb value
Change-Id: I6815679900cde6365f2ed7ca874a081babd366c1 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -168,24 +168,26 @@ PyObject *value_Dereference(Value *self)
|
|||||||
{
|
{
|
||||||
if (!self->m_symbolGroup)
|
if (!self->m_symbolGroup)
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
DEBUG_SYMBOL_PARAMETERS params;
|
|
||||||
const HRESULT hr = self->m_symbolGroup->GetSymbolParameters(self->m_index, 1, ¶ms);
|
|
||||||
if (FAILED(hr))
|
|
||||||
Py_RETURN_NONE;
|
|
||||||
|
|
||||||
char *name = getTypeName(params.Module, params.TypeId);
|
char *typeName = getTypeName(self);
|
||||||
|
std::string typeNameStr(typeName);
|
||||||
|
const bool isPointer = isPointerType(typeNameStr);
|
||||||
|
const bool isArray = !isPointer && endsWith(typeNameStr, "]");
|
||||||
|
delete[] typeName;
|
||||||
|
|
||||||
PyObject *ret = reinterpret_cast<PyObject*>(self);
|
if (isPointer || isArray) {
|
||||||
if (endsWith(std::string(name), "*")) {
|
std::string valueName = getSymbolName(self);
|
||||||
if (numberOfChildren(self) > 0 && expandValue(self)) {
|
if (isPointer)
|
||||||
ULONG symbolCount = 0;
|
valueName.insert(0, 1, '*');
|
||||||
self->m_symbolGroup->GetNumberSymbols(&symbolCount);
|
else
|
||||||
if (symbolCount > self->m_index + 1)
|
valueName.append("[0]");
|
||||||
ret = createValue(self->m_index + 1, self->m_symbolGroup);
|
ULONG index = DEBUG_ANY_ID;
|
||||||
}
|
if (SUCCEEDED(self->m_symbolGroup->AddSymbol(valueName.c_str(), &index)))
|
||||||
|
return createValue(index, self->m_symbolGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete[] name;
|
PyObject *ret = reinterpret_cast<PyObject*>(self);
|
||||||
|
Py_XINCREF(ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user