forked from qt-creator/qt-creator
Debugger: Add debug messages to the cdb python module
Change-Id: I53f9df68ff7918f63ffb10b8d80192c78cad3cb3 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -31,6 +31,8 @@ void initCdbextPythonModule();
|
|||||||
|
|
||||||
PyObject *pyBool(bool);
|
PyObject *pyBool(bool);
|
||||||
|
|
||||||
|
constexpr bool debugPyCdbextModule = false;
|
||||||
|
|
||||||
/* TODO's
|
/* TODO's
|
||||||
class Field:
|
class Field:
|
||||||
isBaseClass() -> bool # Whether this is a base class or normal member
|
isBaseClass() -> bool # Whether this is a base class or normal member
|
||||||
|
@@ -33,6 +33,9 @@
|
|||||||
#include "stringutils.h"
|
#include "stringutils.h"
|
||||||
#include "symbolgroupvalue.h"
|
#include "symbolgroupvalue.h"
|
||||||
|
|
||||||
|
constexpr bool debugPyType = false;
|
||||||
|
constexpr bool debuggingEnabled() { return debugPyType || debugPyCdbextModule; }
|
||||||
|
|
||||||
enum TypeCodes {
|
enum TypeCodes {
|
||||||
TypeCodeTypedef,
|
TypeCodeTypedef,
|
||||||
TypeCodeStruct,
|
TypeCodeStruct,
|
||||||
@@ -51,6 +54,8 @@ enum TypeCodes {
|
|||||||
|
|
||||||
PyObject *lookupType(const std::string &typeNameIn)
|
PyObject *lookupType(const std::string &typeNameIn)
|
||||||
{
|
{
|
||||||
|
if (debuggingEnabled())
|
||||||
|
DebugPrint() << "lookup type '" << typeNameIn << "'";
|
||||||
std::string typeName = typeNameIn;
|
std::string typeName = typeNameIn;
|
||||||
CIDebugSymbols *symbols = ExtensionCommandContext::instance()->symbols();
|
CIDebugSymbols *symbols = ExtensionCommandContext::instance()->symbols();
|
||||||
std::string fullTypeName = typeName;
|
std::string fullTypeName = typeName;
|
||||||
@@ -281,8 +286,12 @@ PyObject *type_TemplateArgument(Type *self, PyObject *args)
|
|||||||
PyObject *type_TemplateArguments(Type *self)
|
PyObject *type_TemplateArguments(Type *self)
|
||||||
{
|
{
|
||||||
std::vector<std::string> innerTypes = innerTypesOf(getTypeName(self));
|
std::vector<std::string> innerTypes = innerTypesOf(getTypeName(self));
|
||||||
|
if (debuggingEnabled())
|
||||||
|
DebugPrint() << "template arguments of: " << getTypeName(self);
|
||||||
auto templateArguments = PyList_New(0);
|
auto templateArguments = PyList_New(0);
|
||||||
for (const std::string &innerType : innerTypes) {
|
for (const std::string &innerType : innerTypes) {
|
||||||
|
if (debuggingEnabled())
|
||||||
|
DebugPrint() << " template argument: " << innerType;
|
||||||
PyObject* childValue;
|
PyObject* childValue;
|
||||||
try {
|
try {
|
||||||
int integer = std::stoi(innerType);
|
int integer = std::stoi(innerType);
|
||||||
|
Reference in New Issue
Block a user