- Fixed setting 'constant' regardless of error type (only used for memoryErrorExp)
- Freeing data for debugger error expressions
- Fixed some memory errors missing addresses
- Making use of dereferenceError
- Improved evaluation pathways to resolve in less unknown errors
- Treating both class and struct members expression errors the same way
return __extension__ ({
struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
-__ecereInstance1->type = 25, __ecereInstance1->compound = compound, __ecereInstance1;
+__ecereInstance1->type = 23, __ecereInstance1->compound = compound, __ecereInstance1;
});
}
return __extension__ ({
struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
-__ecereInstance1->type = 34, __ecereInstance1->list = expressions, __ecereInstance1->loc = yylloc, __ecereInstance1;
+__ecereInstance1->type = 32, __ecereInstance1->list = expressions, __ecereInstance1->loc = yylloc, __ecereInstance1;
});
}
return __extension__ ({
struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
-__ecereInstance1->type = 35, __ecereInstance1->initializer.typeName = typeName, __ecereInstance1->initializer.initializer = initializer, __ecereInstance1->loc = yylloc, __ecereInstance1;
+__ecereInstance1->type = 33, __ecereInstance1->initializer.typeName = typeName, __ecereInstance1->initializer.initializer = initializer, __ecereInstance1->loc = yylloc, __ecereInstance1;
});
}
return __extension__ ({
struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
-__ecereInstance1->type = 38, __ecereInstance1->typeName = typeName, __ecereInstance1;
+__ecereInstance1->type = 36, __ecereInstance1->typeName = typeName, __ecereInstance1;
});
}
return __extension__ ({
struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
-__ecereInstance1->type = 29, __ecereInstance1->_renew.exp = memExp, __ecereInstance1->_renew.typeName = type, __ecereInstance1->_renew.size = size, __ecereInstance1;
+__ecereInstance1->type = 27, __ecereInstance1->_renew.exp = memExp, __ecereInstance1->_renew.typeName = type, __ecereInstance1->_renew.size = size, __ecereInstance1;
});
}
return __extension__ ({
struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
-__ecereInstance1->type = 28, __ecereInstance1->_new.typeName = type, __ecereInstance1->_new.size = size, __ecereInstance1;
+__ecereInstance1->type = 26, __ecereInstance1->_new.typeName = type, __ecereInstance1->_new.size = size, __ecereInstance1;
});
}
return __extension__ ({
struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
-__ecereInstance1->type = 36, __ecereInstance1->vaArg.exp = exp, __ecereInstance1->vaArg.typeName = type, __ecereInstance1;
+__ecereInstance1->type = 34, __ecereInstance1->vaArg.exp = exp, __ecereInstance1->vaArg.typeName = type, __ecereInstance1;
});
}
return __extension__ ({
struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
-__ecereInstance1->type = 26, __ecereInstance1->_classExp.specifiers = specifiers, __ecereInstance1->_classExp.decl = decl, __ecereInstance1;
+__ecereInstance1->type = 24, __ecereInstance1->_classExp.specifiers = specifiers, __ecereInstance1->_classExp.decl = decl, __ecereInstance1;
});
}
return __extension__ ({
struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
-__ecereInstance1->type = 27, __ecereInstance1->classData.id = id, __ecereInstance1;
+__ecereInstance1->type = 25, __ecereInstance1->classData.id = id, __ecereInstance1;
});
}
return __extension__ ({
struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
-__ecereInstance1->type = 30, __ecereInstance1->dbopen.ds = ds, __ecereInstance1->dbopen.name = dbName, __ecereInstance1;
+__ecereInstance1->type = 28, __ecereInstance1->dbopen.ds = ds, __ecereInstance1->dbopen.name = dbName, __ecereInstance1;
});
}
return __extension__ ({
struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
-__ecereInstance1->type = 31, __ecereInstance1->db.table = table, __ecereInstance1->db.id = id, __ecereInstance1;
+__ecereInstance1->type = 29, __ecereInstance1->db.table = table, __ecereInstance1->db.id = id, __ecereInstance1;
});
}
return __extension__ ({
struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
-__ecereInstance1->type = 33, __ecereInstance1->db.table = table, __ecereInstance1->db.id = id, __ecereInstance1;
+__ecereInstance1->type = 31, __ecereInstance1->db.table = table, __ecereInstance1->db.id = id, __ecereInstance1;
});
}
return __extension__ ({
struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
-__ecereInstance1->type = 32, __ecereInstance1->db.table = table, __ecereInstance1;
+__ecereInstance1->type = 30, __ecereInstance1->db.table = table, __ecereInstance1;
});
}
return __extension__ ({
struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
-__ecereInstance1->type = 37, __ecereInstance1->list = expressions, __ecereInstance1;
+__ecereInstance1->type = 35, __ecereInstance1->list = expressions, __ecereInstance1;
});
}
case 10:
result = MkExpTypeSize(CopyTypeName(exp->typeName));
break;
-case 38:
+case 36:
result = MkExpTypeAlign(CopyTypeName(exp->typeName));
break;
case 11:
result = MkExpCondition(CopyExpression(exp->cond.cond), list, CopyExpression(exp->cond.elseExp));
break;
}
-case 36:
+case 34:
result = MkExpVaArg(CopyExpression(exp->vaArg.exp), CopyTypeName(exp->vaArg.typeName));
break;
-case 25:
+case 23:
result = MkExpExtensionCompound(CopyStatement(exp->compound));
break;
-case 35:
+case 33:
result = MkExpExtensionInitializer(CopyTypeName(exp->initializer.typeName), CopyInitializer(exp->initializer.initializer));
break;
}
break;
case 16:
break;
-case 31:
+case 29:
{
char tableName[1024];
char name[1024];
exp->identifier = MkIdentifier(name);
break;
}
-case 32:
+case 30:
{
char tableName[1024];
char name[1024];
exp->identifier = MkIdentifier(name);
break;
}
-case 33:
+case 31:
{
char tableName[1024];
char name[1024];
exp->identifier = MkIdentifier(name);
break;
}
-case 30:
+case 28:
{
if(tableStatements)
{
__ecereInstance1->parent = ifDBStmt->compound.context, __ecereInstance1;
});
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ifDBStmt->compound.statements), MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("Commit")), MkList()))));
-exp->type = 25;
+exp->type = 23;
exp->compound = databaseOpenStmt;
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*databaseOpenStmt->compound.statements), MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier("db")))));
tableStatements = (((void *)0));
__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "dummyExp", 16);
__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "dereferenceErrorExp", 17);
__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "symbolErrorExp", 18);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "classMemberSymbolErrorExp", 19);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "structMemberSymbolErrorExp", 20);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "memoryErrorExp", 21);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "unknownErrorExp", 22);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "noDebuggerErrorExp", 23);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "debugStateErrorExp", 24);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "extensionCompoundExp", 25);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "classExp", 26);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "classDataExp", 27);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "new0Exp", 28);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "renew0Exp", 29);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "dbopenExp", 30);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "dbfieldExp", 31);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "dbtableExp", 32);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "dbindexExp", 33);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "extensionExpressionExp", 34);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "extensionInitializerExp", 35);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "vaArgExp", 36);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "arrayExp", 37);
-__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "typeAlignExp", 38);
+__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "memberSymbolErrorExp", 19);
+__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "memoryErrorExp", 20);
+__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "unknownErrorExp", 21);
+__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "noDebuggerErrorExp", 22);
+__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "extensionCompoundExp", 23);
+__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "classExp", 24);
+__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "classDataExp", 25);
+__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "new0Exp", 26);
+__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "renew0Exp", 27);
+__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "dbopenExp", 28);
+__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "dbfieldExp", 29);
+__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "dbtableExp", 30);
+__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "dbindexExp", 31);
+__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "extensionExpressionExp", 32);
+__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "extensionInitializerExp", 33);
+__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "vaArgExp", 34);
+__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "arrayExp", 35);
+__ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "typeAlignExp", 36);
class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(4, "MemberType", 0, 0, 0, 0, 0, module, 1, 1);
if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
__ecereClass_MemberType = class;
switch(exp->type)
{
case 13:
-case 28:
+case 26:
FreeExpression(exp->_new.size);
FreeTypeName(exp->_new.typeName);
break;
case 14:
-case 29:
+case 27:
FreeExpression(exp->_renew.exp);
FreeExpression(exp->_renew.size);
FreeTypeName(exp->_renew.typeName);
case 10:
FreeTypeName(exp->_new.typeName);
break;
-case 38:
+case 36:
FreeTypeName(exp->_new.typeName);
break;
case 11:
FreeExpression(exp->cond.elseExp);
break;
}
-case 25:
+case 23:
{
if(exp->compound)
FreeStatement(exp->compound);
break;
}
-case 34:
+case 32:
{
if(exp->list)
FreeList(exp->list, FreeExpression);
break;
}
-case 35:
+case 33:
{
if(exp->initializer.typeName)
FreeTypeName(exp->initializer.typeName);
}
case 16:
break;
-case 26:
+case 24:
if(exp->_classExp.specifiers)
FreeList(exp->_classExp.specifiers, FreeSpecifier);
if(exp->_classExp.decl)
FreeDeclarator(exp->_classExp.decl);
break;
+case 29:
case 31:
-case 33:
-case 32:
+case 30:
if(exp->db.id)
FreeIdentifier(exp->db.id);
(__ecereNameSpace__ecere__com__eSystem_Delete(exp->db.table), exp->db.table = 0);
break;
-case 30:
+case 28:
if(exp->dbopen.ds)
FreeExpression(exp->dbopen.ds);
if(exp->dbopen.name)
FreeExpression(exp->dbopen.name);
break;
-case 36:
+case 34:
if(exp->vaArg.exp)
FreeExpression(exp->vaArg.exp);
if(exp->vaArg.typeName)
FreeTypeName(exp->vaArg.typeName);
break;
-case 37:
+case 35:
if(exp->list)
FreeList(exp->list, FreeExpression);
break;
if(exp->_class)
FreeSpecifier(exp->_class);
break;
-case 27:
+case 25:
if(exp->classData.id)
FreeIdentifier(exp->classData.id);
break;
+case 18:
+if(exp->identifier)
+FreeIdentifier(exp->identifier);
+break;
+case 20:
+(__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
+break;
+case 19:
+if(exp->member.exp)
+FreeExpression(exp->member.exp);
+if(exp->member.member)
+FreeIdentifier(exp->member.member);
+break;
+case 17:
+case 21:
+case 22:
+break;
}
if(freePointer)
{
{
switch(exp->type)
{
-case 26:
+case 24:
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))__extension__ ({
struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
})[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, ")");
}
break;
-case 25:
+case 23:
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))__extension__ ({
struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
__internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
})[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "]");
break;
-case 28:
+case 26:
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))__extension__ ({
struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
__internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
})[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "]");
break;
-case 29:
+case 27:
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))__extension__ ({
struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
OutputExpression(exp->op.exp2, f);
}
break;
-case 34:
+case 32:
case 5:
{
struct Expression * expression;
-if(exp->type == 34)
+if(exp->type == 32)
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))__extension__ ({
struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
__internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
})[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, ")");
break;
-case 38:
+case 36:
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))__extension__ ({
struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
__internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
})[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, ")");
break;
-case 35:
+case 33:
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))__extension__ ({
struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
if(exp->cond.elseExp)
OutputExpression(exp->cond.elseExp, f);
break;
-case 36:
+case 34:
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))__extension__ ({
struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
__internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
})[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, ")");
break;
-case 37:
+case 35:
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))__extension__ ({
struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
break;
}
case 13:
-case 28:
+case 26:
CheckPublicExpression(exp->_new.size, access);
break;
case 14:
-case 29:
+case 27:
CheckPublicExpression(exp->_renew.size, access);
CheckPublicExpression(exp->_renew.exp, access);
break;
decl = SpecDeclFromString(string, specs, (((void *)0)));
FreeExpContents(sourceExp);
FreeType(sourceExp->expType);
-sourceExp->type = 26;
+sourceExp->type = 24;
sourceExp->_classExp.specifiers = specs;
sourceExp->_classExp.decl = decl;
sourceExp->expType = dest;
}
else
{
-while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
+while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->list)
sourceExp = (*sourceExp->list).last;
if(sourceExp->type == 0)
{
break;
}
case 5:
-case 34:
+case 32:
{
struct Expression * e, * n;
struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
-if(type->kind == 19 && exp->member.exp->type == 26)
+if(type->kind == 19 && exp->member.exp->type == 24)
_class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
if(!_class)
{
ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
-exp->type = 25;
+exp->type = 23;
exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
-exp->type = 25;
+exp->type = 23;
exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
{
struct Expression * checkedExp = e, * newExp;
-while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
+while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
{
-if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
+if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
{
-if(checkedExp->type == 25)
+if(checkedExp->type == 23)
{
checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
}
char name[100];
struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
-e->type = 25;
+e->type = 23;
sprintf(name, "__internalValue%03X", internalValueCounter++);
if(!curCompound->compound.declarations)
curCompound->compound.declarations = MkList();
}
}
checkedExp = e;
-while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
+while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
{
-if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
+if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
{
-if(checkedExp->type == 25)
+if(checkedExp->type == 23)
{
checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
}
break;
}
case 13:
-case 28:
+case 26:
ProcessExpressionType(exp->_new.size);
exp->expType = __extension__ ({
struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
DeclareType(exp->expType->type, 0x0, 0x0);
break;
case 14:
-case 29:
+case 27:
ProcessExpressionType(exp->_renew.size);
ProcessExpressionType(exp->_renew.exp);
exp->expType = __extension__ ({
break;
}
case 5:
-case 34:
+case 32:
{
struct Expression * e;
int typeKind = type->kind;
struct __ecereNameSpace__ecere__com__Class * _class = (id && (!id->_class || id->_class->name)) ? (id->classSym ? id->classSym->registered : (type->_class ? type->_class->registered : (((void *)0)))) : (((void *)0));
-if(typeKind == 19 && exp->member.exp->type == 26)
+if(typeKind == 19 && exp->member.exp->type == 24)
{
_class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
typeKind = 8;
}
break;
}
-case 35:
+case 33:
{
struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
exp->expType = type;
break;
}
-case 36:
+case 34:
{
struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
exp->isConstant = 0x0;
break;
}
-case 25:
+case 23:
{
if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
{
}
break;
}
-case 26:
+case 24:
{
struct Specifier * spec = (*exp->_classExp.specifiers).first;
}
break;
}
-case 27:
+case 25:
{
struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
}
break;
}
-case 37:
+case 35:
{
struct Type * type = (((void *)0));
char * typeString = (((void *)0));
char iteratorType[1024];
struct Type * source;
struct Expression * e;
-unsigned int isBuiltin = exp && (*exp).last && (((struct Expression *)(*exp).last)->type == 37 || (((struct Expression *)(*exp).last)->type == 11 && ((struct Expression *)(*exp).last)->cast.exp->type == 37));
+unsigned int isBuiltin = exp && (*exp).last && (((struct Expression *)(*exp).last)->type == 35 || (((struct Expression *)(*exp).last)->type == 11 && ((struct Expression *)(*exp).last)->cast.exp->type == 35));
struct Expression * arrayExp;
char * typeString = (((void *)0));
int builtinCount = 0;
struct Type * type = (((void *)0));
char typeStringBuf[1024];
-arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
+arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
if(((struct Expression *)(*exp).last)->type == 11)
{
struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
tempCount++;
curExternal->function->tempCount = (__simpleStruct0 = curExternal->function->tempCount, (__simpleStruct0 > tempCount) ? __simpleStruct0 : tempCount);
sprintf(ecereTemp, "__ecereInstance%d", tempCount);
-exp->type = 25;
+exp->type = 23;
exp->compound = MkCompoundStmt((((void *)0)), (((void *)0)));
exp->compound->compound.context = PushContext();
exp->compound->compound.context->simpleID = exp->compound->compound.context->parent->simpleID;
case 3:
break;
case 13:
-case 28:
+case 26:
ProcessExpression(exp->_new.size);
break;
case 14:
-case 29:
+case 27:
ProcessExpression(exp->_renew.size);
ProcessExpression(exp->_renew.exp);
break;
}
break;
}
-case 34:
+case 32:
case 5:
{
struct Expression * e;
}
break;
}
-case 25:
+case 23:
{
if(exp->compound->compound.statements && ((struct Statement *)(*exp->compound->compound.statements).last)->type == 3 && ((struct Statement *)(*exp->compound->compound.statements).last)->expressions && (*((struct Statement *)(*exp->compound->compound.statements).last)->expressions).last)
{
ProcessStatement(exp->compound);
break;
}
-case 36:
+case 34:
{
ProcessExpression(exp->vaArg.exp);
break;
}
-case 35:
+case 33:
{
ProcessInitializer(exp->initializer.initializer);
break;
{
struct Expression * memberExp = *memberExpPtr;
-if(memberExp && memberExp->type == 8 && memberExp->member.exp && (memberExp->member.exp->type == 5 || memberExp->member.exp->type == 34))
+if(memberExp && memberExp->type == 8 && memberExp->member.exp && (memberExp->member.exp->type == 5 || memberExp->member.exp->type == 32))
{
struct Expression * bracketExp = memberExp->member.exp;
struct Expression * idExp = (*bracketExp->list).last;
*expPtr = exp;
}
}
-else if(*expPtr && (*expPtr)->type == 4 && (*expPtr)->op.op == '&' && !(*expPtr)->op.exp1 && memberExp && (memberExp->type == 5 || memberExp->type == 34) && memberExp->list && (*memberExp->list).count > 1)
+else if(*expPtr && (*expPtr)->type == 4 && (*expPtr)->op.op == '&' && !(*expPtr)->op.exp1 && memberExp && (memberExp->type == 5 || memberExp->type == 32) && memberExp->list && (*memberExp->list).count > 1)
{
struct Expression * newExp = (((void *)0));
struct Expression * exp = *expPtr;
for(; ; )
{
-if(exp->type == 5 || exp->type == 34)
+if(exp->type == 5 || exp->type == 32)
{
if(exp->list)
{
for(; exp; )
{
-if(exp->type == 5 || exp->type == 34)
+if(exp->type == 5 || exp->type == 32)
{
if((*exp->list).count > 1)
byReference = 0x1;
case 3:
break;
case 13:
-case 28:
+case 26:
case 14:
-case 29:
+case 27:
{
struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
-if(exp->type == 14 || exp->type == 29)
+if(exp->type == 14 || exp->type == 27)
ListAdd(args, exp->_renew.exp);
ListAdd(args, MkExpOp(MkExpTypeSize(exp->_new.typeName), '*', MkExpBrackets(MkListOne(exp->_new.size))));
switch(exp->type)
case 13:
exp->call.exp = QMkExpId("ecere::com::eSystem_New");
break;
-case 28:
+case 26:
exp->call.exp = QMkExpId("ecere::com::eSystem_New0");
break;
case 14:
exp->call.exp = QMkExpId("ecere::com::eSystem_Renew");
break;
-case 29:
+case 27:
exp->call.exp = QMkExpId("ecere::com::eSystem_Renew0");
break;
}
{
if(testExp->type == 11)
testExp = testExp->cast.exp;
-else if(testExp->type == 5 || testExp->type == 34)
+else if(testExp->type == 5 || testExp->type == 32)
testExp = (*testExp->list).last;
else if(testExp->type == 8)
break;
}
}
memberExp = exp->op.exp1;
-while(memberExp && ((memberExp->type == 5 && (*memberExp->list).count == 1) || memberExp->type == 34 || memberExp->type == 25))
+while(memberExp && ((memberExp->type == 5 && (*memberExp->list).count == 1) || memberExp->type == 32 || memberExp->type == 23))
{
parentExp = memberExp;
-if(memberExp->type == 25)
+if(memberExp->type == 23)
memberExp = (*((struct Statement *)(*memberExp->compound->compound.statements).last)->expressions).last;
else
memberExp = (*memberExp->list).last;
if(memberExp && memberExp->type == 6 && memberExp->index.exp && memberExp->index.exp->expType && memberExp->index.exp->expType->kind == 8 && memberExp->index.exp->expType->_class && memberExp->index.exp->expType->_class->registered && memberExp->index.exp->expType->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(memberExp->index.exp->expType->_class->registered, containerClass))
{
ProcessExpression(memberExp);
-while(memberExp && ((memberExp->type == 5 && (*memberExp->list).count == 1) || memberExp->type == 34 || memberExp->type == 25))
+while(memberExp && ((memberExp->type == 5 && (*memberExp->list).count == 1) || memberExp->type == 32 || memberExp->type == 23))
{
parentExp = memberExp;
-if(memberExp->type == 25)
+if(memberExp->type == 23)
memberExp = (*((struct Statement *)(*memberExp->compound->compound.statements).last)->expressions).last;
else
memberExp = (*memberExp->list).last;
}
-if(memberExp && memberExp->type == 25)
+if(memberExp && memberExp->type == 23)
{
parentExp = memberExp;
-if(memberExp->type == 25)
+if(memberExp->type == 23)
{
struct Statement * stmt = memberExp->compound->compound.statements ? (*memberExp->compound->compound.statements).last : (((void *)0));
exp1 = (((void *)0));
else
{
-if(parentExp->type == 25)
+if(parentExp->type == 23)
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*((struct Statement *)(*parentExp->compound->compound.statements).last)->expressions), memberExp);
else
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*parentExp->list), memberExp);
curExternal->function->tempCount = (__simpleStruct0 = curExternal->function->tempCount, __simpleStruct1 = exp->tempCount, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
sprintf(ecereTemp, "__ecTemp%d", exp->tempCount);
curContext = context;
-exp->type = 25;
+exp->type = 23;
exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(MkListOne(MkSpecifier(VOID)), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(ecereTemp))), MkInitializerAssignment(QBrackets(memberExp->member.exp)))))), list);
args = MkList();
if(convertTo)
{
struct Expression * newExp = exp;
-if(parentExp && parentExp->type == 25)
+if(parentExp && parentExp->type == 23)
{
newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*((struct Statement *)(*parentExp->compound->compound.statements).last)->expressions), newExp);
break;
}
case 5:
-case 34:
+case 32:
{
if(exp->list)
{
struct Expression * checkedExp = exp->index.exp;
unsigned int isBuiltin = 0x0;
-while(checkedExp->type == 25 || checkedExp->type == 5 || checkedExp->type == 11)
+while(checkedExp->type == 23 || checkedExp->type == 5 || checkedExp->type == 11)
{
-if(checkedExp->type == 25)
+if(checkedExp->type == 23)
{
isBuiltin = 0x1;
break;
struct Expression * parentExp = (((void *)0));
struct Expression * newExp;
-while(((checkedExp->type == 5 || checkedExp->type == 34) && checkedExp->list) || checkedExp->type == 11)
+while(((checkedExp->type == 5 || checkedExp->type == 32) && checkedExp->list) || checkedExp->type == 11)
{
parentExp = checkedExp;
-if(checkedExp->type == 5 || checkedExp->type == 34)
+if(checkedExp->type == 5 || checkedExp->type == 32)
checkedExp = (*checkedExp->list).last;
else if(checkedExp->type == 11)
checkedExp = checkedExp->cast.exp;
}
newExp = (typedObject && !memberExp->member.exp->expType->classObjectType) ? checkedExp : MkExpOp((((void *)0)), '&', checkedExp);
-if(parentExp && (parentExp->type == 5 || parentExp->type == 34))
+if(parentExp && (parentExp->type == 5 || parentExp->type == 32))
{
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*parentExp->list), checkedExp);
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*parentExp->list), newExp);
checkedExp = e;
parentExp = exp;
-while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
+while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
{
parentExp = checkedExp;
-if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
+if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
{
-if(checkedExp->type == 25)
+if(checkedExp->type == 23)
{
checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
}
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->call.arguments), e);
e = newExp;
}
-else if(parentExp->type == 5 || parentExp->type == 34)
+else if(parentExp->type == 5 || parentExp->type == 32)
{
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*parentExp->list), checkedExp);
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*parentExp->list), newExp);
}
parentExp->cast.exp = newExp;
}
-else if(parentExp->type == 25)
+else if(parentExp->type == 23)
{
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*((struct Statement *)(*parentExp->compound->compound.statements).last)->expressions), checkedExp);
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*((struct Statement *)(*parentExp->compound->compound.statements).last)->expressions), newExp);
decl = SpecDeclFromString(typeString, specs, (((void *)0)));
newExp->destType = ProcessType(specs, decl);
curContext = context;
-e->type = 25;
+e->type = 23;
if(curCompound)
{
char name[100];
}
checkedExp = e;
parentExp = exp;
-while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
+while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
{
parentExp = checkedExp;
-if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
+if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
{
-if(checkedExp->type == 25)
+if(checkedExp->type == 23)
{
checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
}
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->call.arguments), e);
e = newExp;
}
-else if(parentExp->type == 5 || parentExp->type == 34)
+else if(parentExp->type == 5 || parentExp->type == 32)
{
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*parentExp->list), checkedExp);
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*parentExp->list), newExp);
}
else if(parentExp->type == 11)
parentExp->cast.exp = newExp;
-else if(parentExp->type == 5 || parentExp->type == 25)
+else if(parentExp->type == 5 || parentExp->type == 23)
{
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*((struct Statement *)(*parentExp->compound->compound.statements).last)->expressions), checkedExp);
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*((struct Statement *)(*parentExp->compound->compound.statements).last)->expressions), newExp);
struct Expression * c;
struct Context * context = PushContext();
-if(_class->templateClass && !strcmp(_class->templateClass->name, "Container") && e->list && (*e->list).first && ((struct Expression *)(*e->list).first)->type == 11 && ((struct Expression *)(*e->list).first)->cast.exp && ((struct Expression *)(*e->list).first)->cast.exp->type == 4 && ((struct Expression *)(*e->list).first)->cast.exp->op.op == '&' && ((struct Expression *)(*e->list).first)->cast.exp->op.exp2 && ((struct Expression *)(*e->list).first)->cast.exp->op.exp2->type == 35)
+if(_class->templateClass && !strcmp(_class->templateClass->name, "Container") && e->list && (*e->list).first && ((struct Expression *)(*e->list).first)->type == 11 && ((struct Expression *)(*e->list).first)->cast.exp && ((struct Expression *)(*e->list).first)->cast.exp->type == 4 && ((struct Expression *)(*e->list).first)->cast.exp->op.op == '&' && ((struct Expression *)(*e->list).first)->cast.exp->op.exp2 && ((struct Expression *)(*e->list).first)->cast.exp->op.exp2->type == 33)
{
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*exp->call.arguments), e->prev, MkExpIdentifier(MkIdentifier(className)));
}
struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
unsigned int thisPtr = exp->member.thisPtr;
-if(type->kind == 19 && exp->member.exp->type == 26)
+if(type->kind == 19 && exp->member.exp->type == 24)
_class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
if(!_class)
{
structName[0] = (char)0;
FullClassNameCat(structName, member->_class->fullName, 0x0);
checkedExp = exp->member.exp;
-while(((checkedExp->type == 5 || checkedExp->type == 34) && checkedExp->list && (*checkedExp->list).count == 1) || checkedExp->type == 11)
+while(((checkedExp->type == 5 || checkedExp->type == 32) && checkedExp->list && (*checkedExp->list).count == 1) || checkedExp->type == 11)
{
-if(checkedExp->type == 5 || checkedExp->type == 34)
+if(checkedExp->type == 5 || checkedExp->type == 32)
checkedExp = (*checkedExp->list).last;
else if(checkedExp->type == 11)
checkedExp = checkedExp->cast.exp;
}
break;
}
-case 25:
+case 23:
{
struct Expression * e = (*((struct Statement *)(*exp->compound->compound.statements).last)->expressions).last;
ProcessExpression(exp->cond.elseExp);
break;
}
-case 26:
+case 24:
{
if(exp->_classExp.specifiers && (*exp->_classExp.specifiers).first && ((struct Specifier *)(*exp->_classExp.specifiers).first)->type == 8)
{
}
break;
}
-case 36:
+case 34:
{
ProcessExpression(exp->vaArg.exp);
break;
}
-case 35:
+case 33:
{
ProcessInitializer(exp->initializer.initializer);
break;
if(exp->op.exp2)
InstDeclPassExpression(exp->op.exp2);
break;
-case 34:
+case 32:
case 5:
{
struct Expression * e;
InstDeclPassExpression(exp->cond.elseExp);
break;
}
-case 25:
+case 23:
{
InstDeclPassStatement(exp->compound);
break;
}
-case 36:
+case 34:
{
InstDeclPassExpression(exp->vaArg.exp);
break;
}
-case 35:
+case 33:
{
InstDeclPassTypeName(exp->initializer.typeName, 0x0);
InstDeclPassInitializer(exp->initializer.initializer);
identifierExp, instanceExp, constantExp, stringExp, opExp,
bracketsExp, indexExp, callExp, memberExp, pointerExp, typeSizeExp,
castExp, conditionExp, newExp, renewExp, classSizeExp,
- dummyExp, dereferenceErrorExp, symbolErrorExp, classMemberSymbolErrorExp,
- structMemberSymbolErrorExp, memoryErrorExp, unknownErrorExp,
- noDebuggerErrorExp, debugStateErrorExp,
+ dummyExp, dereferenceErrorExp, symbolErrorExp,
+ memberSymbolErrorExp, memoryErrorExp, unknownErrorExp,
+ noDebuggerErrorExp,
extensionCompoundExp, classExp, classDataExp, new0Exp, renew0Exp,
dbopenExp, dbfieldExp, dbtableExp, dbindexExp, extensionExpressionExp, extensionInitializerExp,
vaArgExp, arrayExp, typeAlignExp
if(exp.classData.id)
FreeIdentifier(exp.classData.id);
break;
+ case symbolErrorExp:
+ if(exp.identifier)
+ FreeIdentifier(exp.identifier);
+ break;
+ case memoryErrorExp:
+ delete exp.constant;
+ break;
+ case memberSymbolErrorExp:
+ if(exp.member.exp)
+ FreeExpression(exp.member.exp);
+ if(exp.member.member)
+ FreeIdentifier(exp.member.member);
+ break;
+ case dereferenceErrorExp:
+ case unknownErrorExp:
+ case noDebuggerErrorExp:
+ break;
}
if(freePointer)
{
case symbolErrorExp:
snprintf(watchmsg, sizeof(watchmsg), $"Symbol \"%s\" not found", exp.identifier.string);
break;
- case structMemberSymbolErrorExp:
- // todo get info as in next case (ExpClassMemberSymbolError)
- snprintf(watchmsg, sizeof(watchmsg), $"Error: Struct member not found for \"%s\"", wh.expression);
- break;
- case classMemberSymbolErrorExp:
+ case memberSymbolErrorExp:
+ {
+ Class _class;
+ Expression memberExp = exp.member.exp;
+ Identifier memberID = exp.member.member;
+ Type type = memberExp.expType;
+ if(type)
{
- Class _class;
- Expression memberExp = exp.member.exp;
- Identifier memberID = exp.member.member;
- Type type = memberExp.expType;
- if(type)
+ if(type.kind == structType || type.kind == unionType)
+ {
+ char string[1024] = "";
+ if(!type.name)
+ PrintTypeNoConst(type, string, false, true);
+ snprintf(watchmsg, sizeof(watchmsg), $"Member \"%s\" not found in %s \"%s\"",
+ memberID ? memberID.string : "", type.kind == unionType ? "union" : "struct", type.name ? type.name : string);
+ }
+ else
{
- _class = (memberID && memberID.classSym) ? memberID.classSym.registered : ((type.kind == classType && type._class) ? type._class.registered : null);
+ Class _class = (memberID && memberID.classSym) ? memberID.classSym.registered : ((type.kind == classType && type._class) ? type._class.registered : null);
+ char string[1024] = "";
if(!_class)
{
- char string[256] = "";
Symbol classSym;
PrintTypeNoConst(type, string, false, true);
classSym = FindClass(string);
if(_class)
snprintf(watchmsg, sizeof(watchmsg), $"Member \"%s\" not found in class \"%s\"", memberID ? memberID.string : "", _class.name);
else
- snprintf(watchmsg, sizeof(watchmsg), "Member \"%s\" not found in unregistered class? (Should never get this message)", memberID ? memberID.string : "");
+ // NOTE: This should probably never happen, only classes and struct can be dereferenced, a dereferenceErrorExp should be displayed instead
+ snprintf(watchmsg, sizeof(watchmsg), $"Member \"%s\" not found in type \"%s\"", memberID ? memberID.string : "", string);
}
- else
- snprintf(watchmsg, sizeof(watchmsg), "Member \"%s\" not found in no type? (Should never get this message)", memberID ? memberID.string : "");
}
+ else
+ // NOTE: This should probably never happen, the error causing the unresolved expression should be displayed instead
+ snprintf(watchmsg, sizeof(watchmsg), $"Accessing member \"%s\" from unresolved expression", memberID ? memberID.string : "");
break;
+ }
case memoryErrorExp:
// Need to ensure when set to memoryErrorExp, constant is set
snprintf(watchmsg, sizeof(watchmsg), $"Memory can't be read at %s", /*(exp.type == constantExp) ? */exp.constant /*: null*/);
break;
case dereferenceErrorExp:
- snprintf(watchmsg, sizeof(watchmsg), $"Dereference failure for \"%s\"", wh.expression);
- break;
- case unknownErrorExp:
- snprintf(watchmsg, sizeof(watchmsg), $"Unknown error for \"%s\"", wh.expression);
+ snprintf(watchmsg, sizeof(watchmsg), $"Dereferencing error evaluating for \"%s\"", wh.expression);
break;
case noDebuggerErrorExp:
snprintf(watchmsg, sizeof(watchmsg), $"Debugger required for symbol evaluation in \"%s\"", wh.expression);
break;
- case debugStateErrorExp:
- snprintf(watchmsg, sizeof(watchmsg), $"Incorrect debugger state for symbol evaluation in \"%s\"", wh.expression);
+ case unknownErrorExp:
+ // NOTE: This should never happen
+ snprintf(watchmsg, sizeof(watchmsg), $"Error evaluating \"%s\"", wh.expression);
break;
case 0:
+ // NOTE: This should never happen
snprintf(watchmsg, sizeof(watchmsg), $"Null type for \"%s\"", wh.expression);
break;
case stringExp:
if(item)
wh.value = CopyString(item.name);
else
- wh.value = CopyString($"Invalid Enum Value");
+ wh.value = PrintString($"Invalid Enum Value (", value, ")");
result = true;
}
else if(wh.type && (wh.type.kind == charType || (wh.type.kind == classType && wh.type._class &&
{
char tempString[256];
if(exp.member.memberType == propertyMember)
+ // TODO: Have a propertyErrorExp to carry over
snprintf(watchmsg, sizeof(watchmsg), $"Missing property evaluation support for \"%s\"", wh.expression);
else
- snprintf(watchmsg, sizeof(watchmsg), $"Evaluation failed for \"%s\" of type \"%s\"", wh.expression,
- exp.type.OnGetString(tempString, null, null));
+ // NOTE: This should never happen
+ snprintf(watchmsg, sizeof(watchmsg), $"Error evaluating \"%s\"", wh.expression);
+ /*snprintf(watchmsg, sizeof(watchmsg), $"Evaluation failed for \"%s\" of type \"%s\"", wh.expression,
+ exp.type.OnGetString(tempString, null, null));*/
}
break;
}
else
break;
}
+ delete eval.result;
return result;
}
return null;
result = Debugger::EvaluateExpression(expString, &evalError);
if(result)
{
+ FreeExpContents(exp);
exp.constant = result;
exp.type = constantExp;
}
*temp = *expError;
+ // -- Careful: this could be problematic as FreeExpContents will free the contents of expError
+ // Nulling things that may be freed now, but this is all overly messy/complex
+ switch(expError.type)
+ {
+ case symbolErrorExp:
+ expError.identifier = null;
+ break;
+ case memoryErrorExp:
+ expError.constant = null;
+ break;
+ case memberSymbolErrorExp:
+ expError.member.exp = null;
+ expError.member.member = null;
+ break;
+ }
+
/*
Identifier identifier = expError.identifier;
expError.identifier = null;
exp.identifier = identifier;
exp.type = expError.type;
*/
+ if(exp.expType) FreeType(exp.expType);
+ if(exp.destType) FreeType(exp.destType);
FreeExpContents(exp);
*exp = *temp; //*expError;
delete temp;
/*static */bool ExpressionIsError(Expression exp)
{
- return (exp.type == dereferenceErrorExp || exp.type == symbolErrorExp || exp.type == classMemberSymbolErrorExp ||
- exp.type == structMemberSymbolErrorExp || exp.type == memoryErrorExp || exp.type == unknownErrorExp ||
- exp.type == noDebuggerErrorExp || exp.type == debugStateErrorExp);
+ return (exp.type == dereferenceErrorExp || exp.type == symbolErrorExp ||
+ exp.type == memberSymbolErrorExp || exp.type == memoryErrorExp || exp.type == unknownErrorExp ||
+ exp.type == noDebuggerErrorExp);
}
void DebugComputeExpression(Expression exp)
else
hasAddress = false;
- switch(kind)
+ if(evalError == dummyExp)
{
- case charType:
- delete evaluation;
- evaluation = Debugger::EvaluateExpression(exp.identifier.string, &evalError);
- if(evaluation)
- {
- //int c, len;
- char * temp;
- temp = strstr(evaluation, " '");
- //len = strlen(temp);
- if(temp)
- temp[0] = '\0';
- {/*
- for(c = 0; c < len; c++)
- temp[c] = ' ';
- eString_TrimRSpaces(evaluation, evaluation);
- */}
- }
- else
- {
- exp.type = evalError;
- exp.constant = PrintHexUInt64(address);
- }
- break;
- case shortType:
- case intType:
- case longType:
- case intPtrType:
- case intSizeType:
- case _BoolType:
- case int64Type:
- case floatType:
- case doubleType:
- case enumType:
- case pointerType:
- delete evaluation;
- evaluation = Debugger::EvaluateExpression(exp.identifier.string, &evalError);
- if(evaluation)
- {
- if(kind == pointerType)
+ switch(kind)
+ {
+ case charType:
+ delete evaluation;
+ evaluation = Debugger::EvaluateExpression(exp.identifier.string, &evalError);
+ if(evaluation)
{
- uint64 value;
- value = _strtoui64(evaluation, null, 0);
+ //int c, len;
+ char * temp;
+ temp = strstr(evaluation, " '");
+ //len = strlen(temp);
+ if(temp)
+ temp[0] = '\0';
+ {/*
+ for(c = 0; c < len; c++)
+ temp[c] = ' ';
+ eString_TrimRSpaces(evaluation, evaluation);
+ */}
+ }
+ break;
+ case shortType:
+ case intType:
+ case longType:
+ case intPtrType:
+ case intSizeType:
+ case _BoolType:
+ case int64Type:
+ case floatType:
+ case doubleType:
+ case enumType:
+ case pointerType:
+ delete evaluation;
+ evaluation = Debugger::EvaluateExpression(exp.identifier.string, &evalError);
+ if(evaluation)
+ {
+ if(kind == pointerType)
+ {
+ uint64 value;
+ value = _strtoui64(evaluation, null, 0);
+ delete evaluation;
+ evaluation = PrintHexUInt64(value);
+ }
+ }
+ break;
+ case classType:
+ if(isPointer)
+ {
+ int size;
+ char format;
delete evaluation;
- evaluation = PrintHexUInt64(value);
+ //evaluation = Debugger::EvaluateExpression(exp.identifier.string, &evalError);
+ size = ComputeTypeSize(exp.expType); //exp.expType.arrayType.size;
+ format = GetGdbFormatChar(exp.expType);
+ evaluation = Debugger::ReadMemory(address, size, format, &evalError);
+ if(evaluation)
+ StripQuotes(evaluation, evaluation);
}
- }
- else
+ break;
+ case structType:
+ case unionType:
+ case functionType:
+ //evaluation = Debugger::EvaluateExpression(exp.identifier.string, &evalError);
+ delete evaluation;
+ break;
+ case arrayType:
{
- exp.constant = CopyString("");
- exp.type = evalError;
+ // for classType --> if(_class.type == structClass) ?
+ //char temp[1024];
+ //sprintf(temp, "&%s", exp.identifier.string);
+ //evaluation = Debugger::EvaluateExpression(temp, &evalError);
+ break;
}
- break;
- case classType:
- if(isPointer)
- {
- int size;
- char format;
+ case ellipsisType:
+ case methodType:
+ case vaListType:
+ // case TypeTypedObject, TypeAnyObject, TypeClassPointer:
+ case dummyType:
delete evaluation;
- //evaluation = Debugger::EvaluateExpression(exp.identifier.string, &evalError);
- size = ComputeTypeSize(exp.expType); //exp.expType.arrayType.size;
- format = GetGdbFormatChar(exp.expType);
- evaluation = Debugger::ReadMemory(address, size, format, &evalError);
- if(evaluation)
- StripQuotes(evaluation, evaluation);
- }
- break;
- case structType:
- case unionType:
- case functionType:
- //evaluation = Debugger::EvaluateExpression(exp.identifier.string, &evalError);
- delete evaluation;
- evaluation = null;
- break;
- case arrayType:
- {
- // for classType --> if(_class.type == structClass) ?
- //char temp[1024];
- //sprintf(temp, "&%s", exp.identifier.string);
- //evaluation = Debugger::EvaluateExpression(temp, &evalError);
- break;
+ evaluation = Debugger::EvaluateExpression(exp.identifier.string, &evalError);
+ break;
}
- case ellipsisType:
- case methodType:
- case vaListType:
- // case TypeTypedObject, TypeAnyObject, TypeClassPointer:
- case dummyType:
- delete evaluation;
- evaluation = Debugger::EvaluateExpression(exp.identifier.string, &evalError);
- if(evaluation)
- ;
- else
- {
- exp.constant = CopyString("");
- exp.type = evalError;
- }
- break;
}
- if(evalError != dummyExp)
+ switch(evalError)
{
- exp.type = evalError;
- exp.constant = CopyString("");
- }
- else
- {
- if(evaluation)
- {
- //expNew = ParseExpressionString(evaluation);
- expNew = MkExpConstant(evaluation);
- //printf("Evaluation = %s\n", evaluation);
- delete evaluation;
- expNew.destType = exp.expType;
-
- // WHY EXACTLY MUST WE PROCESS THIS EXPRESSION TYPE AGAIN ? ADDED THIS FOR 0x00000000
- if(exp.expType && exp.expType.kind == pointerType && expNew.destType)
+ case dummyExp:
+ if(evaluation)
{
- expNew.expType = expNew.destType;
- expNew.destType.refCount++;
+ //expNew = ParseExpressionString(evaluation);
+ expNew = MkExpConstant(evaluation);
+ //printf("Evaluation = %s\n", evaluation);
+ delete evaluation;
+ expNew.destType = exp.expType;
+
+ // WHY EXACTLY MUST WE PROCESS THIS EXPRESSION TYPE AGAIN ? ADDED THIS FOR 0x00000000
+ if(exp.expType && (exp.expType.kind == pointerType || exp.expType.kind == classType) && expNew.destType)
+ {
+ expNew.expType = expNew.destType;
+ expNew.destType.refCount++;
+ }
+ else
+ ProcessExpressionType(expNew);
+ FreeType(exp.destType);
+ FreeExpContents(exp);
+
+ DebugComputeExpression(expNew);
+ expNew.prev = prev;
+ expNew.next = next;
+ expNew.isConstant = true;
+ expNew.address = address;
+ expNew.hasAddress = hasAddress;
+ *exp = *expNew;
+ delete expNew;
}
else
- ProcessExpressionType(expNew);
- FreeType(exp.destType);
+ {
+ // Unhandled code path, evaluation is null
+ FreeExpContents(exp);
+ exp.type = unknownErrorExp;
+ }
+ break;
+ case symbolErrorExp:
+ // Keep the identifier
+ exp.type = evalError;
+ break;
+ default:
FreeExpContents(exp);
-
- DebugComputeExpression(expNew);
- expNew.prev = prev;
- expNew.next = next;
- expNew.isConstant = true;
- expNew.address = address;
- expNew.hasAddress = hasAddress;
- *exp = *expNew;
- }
- else
- {
- exp.address = address;
- exp.hasAddress = hasAddress;
- //exp.type = ExpUnknownError;
- }
+ exp.type = evalError;
+ break;
}
- //else
- // exp.type = ExpUnknownError;
-
break;
}
case instanceExp:
expNew.next = next;
expNew.isConstant = true;
*exp = *expNew;
+ delete expNew;
}
else
exp.type = ExpUnknownError;
expNew.next = next;
expNew.isConstant = true;
*exp = *expNew;
+ delete expNew;
}
else
exp1.address = 0;
}
else if(exp.op.op == '*')
{
- uint64 address;
- int size;
- char format;
- GetUInt64(exp1, &address);
- size = ComputeTypeSize(exp.expType); //exp.expType.arrayType.size;
- format = GetGdbFormatChar(exp.expType);
- if(format)
+ if(!exp.expType)
{
- evaluation = Debugger::ReadMemory(address, size, format, &evalError);
- if(evalError != dummyExp)
- {
- exp1.type = evalError;
- exp1.constant = PrintHexUInt64(address);
- expError = exp1;
- }
+ delete evaluation;
+ FreeExpContents(exp1);
+ exp1.type = dereferenceErrorExp;
+ expError = exp1;
+ }
+ else
+ {
+ uint64 address;
+ int size;
+ char format;
+ if(exp1.expType.kind == structType)
+ address = exp1.address;
else
+ GetUInt64(exp1, &address);
+ size = ComputeTypeSize(exp.expType); //exp.expType.arrayType.size;
+ format = GetGdbFormatChar(exp.expType);
+ if(format)
{
- if(evaluation)
- {
- expNew = ParseExpressionString(evaluation);
- expNew.address = address;
- expNew.hasAddress = true;
- delete evaluation;
- expNew.destType = exp.expType;
- FreeType(exp.destType);
- FreeExpContents(exp);
- ProcessExpressionType(expNew);
- DebugComputeExpression(expNew);
- expNew.prev = prev;
- expNew.next = next;
- expNew.isConstant = true;
- *exp = *expNew;
- }
- else
+ evaluation = Debugger::ReadMemory(address, size, format, &evalError);
+ switch(evalError)
{
- exp1.type = unknownErrorExp;
- expError = exp1;
+ case dummyExp:
+ if(evaluation)
+ {
+ expNew = ParseExpressionString(evaluation);
+ expNew.address = address;
+ expNew.hasAddress = true;
+ delete evaluation;
+ expNew.destType = exp.expType;
+ FreeType(exp.destType);
+ FreeExpContents(exp);
+ ProcessExpressionType(expNew);
+ DebugComputeExpression(expNew);
+ expNew.prev = prev;
+ expNew.next = next;
+ expNew.isConstant = true;
+ *exp = *expNew;
+ delete expNew;
+ }
+ else
+ {
+ // Unhandled code path, evaluation is null
+ FreeExpContents(exp);
+ exp.type = unknownErrorExp;
+ }
+ break;
+ case memoryErrorExp:
+ delete evaluation;
+ FreeExpContents(exp1);
+ exp1.type = evalError;
+ exp1.constant = PrintHexUInt64(address);
+ expError = exp1;
+ break;
+ default:
+ delete evaluation;
+ FreeExpContents(exp1);
+ exp1.type = evalError;
+ expError = exp1;
+ break;
+
}
}
- }
- else
- {
- exp1.type = unknownErrorExp; // Not supported yet, generate error to fallback to GDB printout
- expError = exp1;
+ else
+ {
+ FreeExpContents(exp1);
+ exp1.type = unknownErrorExp; // Not supported yet, generate error to fallback to GDB printout
+ expError = exp1;
+ }
}
}
}
expNew.address = address;
expNew.hasAddress = true;
*exp = *expNew;
+ delete expNew;
}
else
exp.type = unknownErrorExp;
expNew.address = address;
expNew.hasAddress = true;
*exp = *expNew;
+ delete expNew;
}
else
exp.type = unknownErrorExp;
}
else
{
+ FreeExpContents(exp);
+
// TESTING THIS HERE...
exp.type = constantExp;
exp.constant = PrintHexUInt64(address);
exp.isConstant = true;
}
}
+ else
+ exp.type = memberSymbolErrorExp;
}
else
- exp.type = classMemberSymbolErrorExp;
+ exp.type = memberSymbolErrorExp;
}
}
}
else
{
- exp.type = classMemberSymbolErrorExp;
+ exp.type = memberSymbolErrorExp;
}
break;
}