Skip to content

Commit

Permalink
Merge pull request #1634 from rainers/cv8_darray
Browse files Browse the repository at this point in the history
fix cv8 array debug info
  • Loading branch information
WalterBright committed Feb 7, 2013
2 parents 77bf09f + 2ec4842 commit 386e909
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/backend/cgcv.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,11 @@ idx_t cv_debtyp(debtyp_t *d)
return debtyptop++ + cgcv.deb_offset;
}

idx_t cv_numdebtypes()
{
return debtyptop;
}

/****************************
* Store a null record at DEB_NULL.
*/
Expand Down
1 change: 1 addition & 0 deletions src/backend/cgcv.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ int cv_namestring ( unsigned char *p , const char *name );
unsigned cv4_typidx(type *t);
idx_t cv4_arglist(type *t,unsigned *pnparam);
unsigned char cv4_callconv(type *t);
idx_t cv_numdebtypes();

#define TOIDX(a,b) ((cgcv.sz_idx == 4) ? TOLONG(a,b) : TOWORD(a,b))

Expand Down
9 changes: 7 additions & 2 deletions src/backend/cv8.c
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ idx_t cv8_darray(type *t, idx_t etypidx)
break;

default:
id = "dArray";
id = t->Tident ? t->Tident : "dArray";
break;
}

Expand All @@ -815,7 +815,12 @@ idx_t cv8_darray(type *t, idx_t etypidx)
TOWORD(d->data + 18, 16); // size
cv_namestring(d->data + 20, id);

return cv_debtyp(d);
idx_t top = cv_numdebtypes();
idx_t debidx = cv_debtyp(d);
if(top != cv_numdebtypes())
cv8_udt(id, debidx);

return debidx;
}

/****************************************
Expand Down
3 changes: 3 additions & 0 deletions src/toctype.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ type *TypeSArray::toCtype()
type *TypeDArray::toCtype()
{
if (!ctype)
{
ctype = type_dyn_array(next->toCtype());
ctype->Tident = toChars(); // needed to generate sensible debug info for cv8
}
return ctype;
}

Expand Down

0 comments on commit 386e909

Please sign in to comment.