considering the following code:
class listOption_c{ public: typedef enum { INFERRING_RAM, READ_FILES, SYNTHESIS, NO_USAGE }usage_print; private: usage_print _command; public: listOption_c(void):_command(INFERRING_RAM){} };
When debugging a varaible of this type, the debugger goes can;t display the class member
However, if the definition is using he more classic (C++) writting;
class listOption_c{ public: enum usage_print{ INFERRING_RAM, READ_FILES, SYNTHESIS, NO_USAGE }; private: usage_print _command; public: listOption_c(void):_command(INFERRING_RAM){} };
The debugger properly display the class member.
Analysis:
the gdbbridge api:
def nativeTypeId(self, nativeType): if nativeType.code == gdb.TYPE_CODE_TYPEDEF: return '%s{%s}' % (nativeType, nativeType.strip_typedefs()) name = str(nativeType) if len(name) == 0: c = '0' elif name == 'union {...}': c = 'u' elif name.endswith('{...}'): c = 's' else: return name typeId = c + ''.join(['{%s:%s}' % (f.name, self.nativeTypeId(f.type)) for f in nativeType.fields()]) return typeId
is responsible for the bug:
Last line ,the access to the f.type field is invalid. It is stated in GDB documentation that:
"The type of the field. This is usually an instance of Type, but it can be None in some situations."
this is the case here and it is not handled property