summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2007-06-12 09:32:02 +0000
committerjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2007-06-12 09:32:02 +0000
commit2912f1a5f25527aa1e94a7c7352c3ff0e1257ea8 (patch)
treeddc95df6ce7e94bbcdfde101fba86b8e83afb816
parentf747551080d23aeb979e30ed73e99050baf5ec6a (diff)
downloadfpc-2912f1a5f25527aa1e94a7c7352c3ff0e1257ea8.tar.gz
* fixed stabs debug info for bitpacked records
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@7634 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--compiler/dbgstabs.pas20
1 files changed, 14 insertions, 6 deletions
diff --git a/compiler/dbgstabs.pas b/compiler/dbgstabs.pas
index ef80c122c3..b67a60ffea 100644
--- a/compiler/dbgstabs.pas
+++ b/compiler/dbgstabs.pas
@@ -350,13 +350,21 @@ implementation
spec:='/0'
else
spec:='';
- varsize:=tfieldvarsym(p).vardef.size;
- { open arrays made overflows !! }
- if varsize>$fffffff then
- varsize:=$fffffff;
- newrec:=def_stabstr_evaluate(nil,'$1:$2,$3,$4;',[GetSymName(tfieldvarsym(p)),
+ if (tabstractrecordsymtable(tsym(p).owner).usefieldalignment<>bit_alignment) then
+ begin
+ varsize:=tfieldvarsym(p).vardef.size;
+ { open arrays made overflows !! }
+ { how can a record/object/class contain an open array? (JM) }
+ if varsize>$fffffff then
+ varsize:=$fffffff;
+ newrec:=def_stabstr_evaluate(nil,'$1:$2,$3,$4;',[GetSymName(tfieldvarsym(p)),
spec+def_stab_number(tfieldvarsym(p).vardef),
- tostr(TConstExprInt(tfieldvarsym(p).fieldoffset)*8),tostr(varsize*8)]);
+ tostr(TConstExprInt(tfieldvarsym(p).fieldoffset)*8),tostr(varsize*8)])
+ end
+ else
+ newrec:=def_stabstr_evaluate(nil,'$1:$2,$3,$4;',[GetSymName(tfieldvarsym(p)),
+ spec+def_stab_number(tfieldvarsym(p).vardef),
+ tostr(TConstExprInt(tfieldvarsym(p).fieldoffset)),tostr(tfieldvarsym(p).vardef.packedbitsize)]);
if state^.stabsize+strlen(newrec)>=state^.staballoc-256 then
begin
inc(state^.staballoc,strlen(newrec)+64);