* always include lineno after fileswitch. valgrind requires this

This commit is contained in:
peter 2002-10-30 21:01:14 +00:00
parent ca3679e4bf
commit 477bc04c6a
2 changed files with 42 additions and 27 deletions

View File

@ -254,6 +254,8 @@ var
tostr(curr_n)+',0,0,'+'Ltext'+ToStr(IncludeCount));
AsmWriteLn('Ltext'+ToStr(IncludeCount)+':');
inc(includecount);
{ force new line info }
stabslastfileinfo.line:=-1;
end;
end;
{ line changed ? }
@ -496,7 +498,7 @@ var
AsmWriteLn(target_asm.comment+target_asm.comment+double2str(tai_real_64bit(hp).value));
d:=tai_real_64bit(hp).value;
{ swap the values to correct endian if required }
{$ifdef fpc}
{$ifdef fpc}
if source_info.endian <> target_info.endian then
swap64bitarray(t64bitarray(d));
{$endif}
@ -519,7 +521,7 @@ var
{ swap the values to correct endian if required }
if source_info.endian <> target_info.endian then
swap32bitarray(t32bitarray(sin));
{$endif}
{$endif}
AsmWrite(#9'.byte'#9);
for i:=0 to 3 do
begin
@ -544,7 +546,7 @@ var
{ swap the values to correct endian if required }
if source_info.endian <> target_info.endian then
swap64bitarray(t64bitarray(co));
{$endif}
{$endif}
for i:=0 to 7 do
begin
if i<>0 then
@ -809,7 +811,10 @@ var
end.
{
$Log$
Revision 1.13 2002-10-05 12:43:23 carl
Revision 1.14 2002-10-30 21:01:14 peter
* always include lineno after fileswitch. valgrind requires this
Revision 1.13 2002/10/05 12:43:23 carl
* fixes for Delphi 6 compilation
(warning : Some features do not work under Delphi)

View File

@ -801,33 +801,40 @@ Implementation
if not ((cs_debuginfo in aktmoduleswitches) or
(cs_gdb_lineinfo in aktglobalswitches)) then
exit;
{ file changed ? (must be before line info) }
{ file changed ? (must be before line info) }
if (fileinfo.fileindex<>0) and
(stabslastfileinfo.fileindex<>fileinfo.fileindex) then
begin
infile:=current_module.sourcefiles.get_file(fileinfo.fileindex);
if includecount=0 then
curr_n:=n_sourcefile
else
curr_n:=n_includefile;
{ get symbol for this includefile }
hp:=objectlibrary.newasmsymboltype('Ltext'+ToStr(IncludeCount),AB_LOCAL,AT_FUNCTION);
if currpass=1 then
begin
hp.setaddress(currpass,objectalloc.currsec,objectalloc.sectionsize,0);
objectlibrary.UsedAsmSymbolListInsert(hp);
end
else
objectdata.writesymbol(hp);
{ emit stabs }
if (infile.path^<>'') then
EmitStabs('"'+lower(BsToSlash(FixPath(infile.path^,false)))+'",'+tostr(curr_n)+
',0,0,Ltext'+ToStr(IncludeCount));
EmitStabs('"'+lower(FixFileName(infile.name^))+'",'+tostr(curr_n)+
',0,0,Ltext'+ToStr(IncludeCount));
inc(includecount);
if assigned(infile) then
begin
if includecount=0 then
curr_n:=n_sourcefile
else
curr_n:=n_includefile;
{ get symbol for this includefile }
hp:=objectlibrary.newasmsymboltype('Ltext'+ToStr(IncludeCount),AB_LOCAL,AT_FUNCTION);
if currpass=1 then
begin
hp.setaddress(currpass,objectalloc.currsec,objectalloc.sectionsize,0);
objectlibrary.UsedAsmSymbolListInsert(hp);
end
else
objectdata.writesymbol(hp);
{ emit stabs }
if (infile.path^<>'') then
EmitStabs('"'+lower(BsToSlash(FixPath(infile.path^,false)))+'",'+tostr(curr_n)+
',0,0,Ltext'+ToStr(IncludeCount));
EmitStabs('"'+lower(FixFileName(infile.name^))+'",'+tostr(curr_n)+
',0,0,Ltext'+ToStr(IncludeCount));
inc(includecount);
{ force new line info }
stabslastfileinfo.line:=-1;
end;
end;
{ line changed ? }
{ line changed ? }
if (stabslastfileinfo.line<>fileinfo.line) and (fileinfo.line<>0) then
emitlineinfostabs(n_line,fileinfo.line);
stabslastfileinfo:=fileinfo;
@ -1608,7 +1615,10 @@ Implementation
end.
{
$Log$
Revision 1.44 2002-09-05 19:29:42 peter
Revision 1.45 2002-10-30 21:01:14 peter
* always include lineno after fileswitch. valgrind requires this
Revision 1.44 2002/09/05 19:29:42 peter
* memdebug enhancements
Revision 1.43 2002/08/20 16:55:38 peter