Mark the symbol that is the name of a scope with the size of that scope
(previously only the scope itself had that size). Pass the size of symbols through the object file to the linker. Bump the object file version and adjust object file reading tools (od65, ar65) to this change. Read the size in the linker and output it in the debug info. Bump the minor version number of the debug info. Read the size and allow to access it via the API. Do better version checking for the debug info and try to be smarter when encountering unknown keywords to improve support for newer minor versions. git-svn-id: svn://svn.cc65.org/cc65/trunk@5057 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -106,7 +106,7 @@ static long DoStructInternal (long Offs, unsigned Type)
|
||||
int Anon = (CurTok.Tok != TOK_IDENT);
|
||||
if (!Anon) {
|
||||
/* Enter a new scope, then skip the name */
|
||||
SymEnterLevel (&CurTok.SVal, ST_STRUCT, ADDR_SIZE_ABS);
|
||||
SymEnterLevel (&CurTok.SVal, ST_STRUCT, ADDR_SIZE_ABS, 0);
|
||||
NextTok ();
|
||||
/* Start at zero offset in the new scope */
|
||||
Offs = 0;
|
||||
@@ -116,8 +116,8 @@ static long DoStructInternal (long Offs, unsigned Type)
|
||||
ConsumeSep ();
|
||||
|
||||
/* Read until end of struct */
|
||||
while (CurTok.Tok != TOK_ENDSTRUCT &&
|
||||
CurTok.Tok != TOK_ENDUNION &&
|
||||
while (CurTok.Tok != TOK_ENDSTRUCT &&
|
||||
CurTok.Tok != TOK_ENDUNION &&
|
||||
CurTok.Tok != TOK_EOF) {
|
||||
|
||||
long MemberSize;
|
||||
@@ -263,12 +263,12 @@ static long DoStructInternal (long Offs, unsigned Type)
|
||||
long GetStructSize (SymTable* Struct)
|
||||
/* Get the size of a struct or union */
|
||||
{
|
||||
SymEntry* Sym = SymFind (Struct, &SizeEntryName, SYM_FIND_EXISTING);
|
||||
if (Sym == 0) {
|
||||
SymEntry* SizeSym = FindSizeOfScope (Struct);
|
||||
if (SizeSym == 0) {
|
||||
Error ("Size of struct/union is unknown");
|
||||
return 0;
|
||||
} else {
|
||||
return GetSymVal (Sym);
|
||||
return GetSymVal (SizeSym);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user