Debugger: Add public pointer size function

Change-Id: I5f60d1b7eca1c036a00dea92887f37687337627e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2016-11-17 15:11:13 +01:00
parent 057c07f5b7
commit edf7ceb790
2 changed files with 7 additions and 2 deletions
+6 -2
View File
@@ -75,8 +75,7 @@ static PyObject *cdbext_listOfLocals(PyObject *, PyObject *) // -> [ Value ]
static PyObject *cdbext_pointerSize(PyObject *, PyObject *)
{
HRESULT isPointer64Bit = ExtensionCommandContext::instance()->control()->IsPointer64Bit();
return Py_BuildValue("i", isPointer64Bit == S_OK ? 8 : 4);
return Py_BuildValue("i", pointerSize());
}
static PyObject *cdbext_readRawMemory(PyObject *, PyObject *args)
@@ -200,3 +199,8 @@ PyObject *pyBool(bool b)
else
Py_RETURN_FALSE;
}
int pointerSize()
{
return ExtensionCommandContext::instance()->control()->IsPointer64Bit() == S_OK ? 8 : 4;
}
@@ -30,6 +30,7 @@
void initCdbextPythonModule();
PyObject *pyBool(bool);
int pointerSize();
constexpr bool debugPyCdbextModule = false;