mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 20:32:41 +02:00
* fixes a stabs problem for functions
+ includes a stabs local var for with statements the name is with in lowercase followed by an index for nested with. + Withdebuglist added because the stabs declarations of local var are postponed to end of function.
This commit is contained in:
parent
95d572ca04
commit
c6a47280b9
@ -335,7 +335,7 @@ type
|
|||||||
exprasmlist,
|
exprasmlist,
|
||||||
{ default lists }
|
{ default lists }
|
||||||
datasegment,codesegment,bsssegment,
|
datasegment,codesegment,bsssegment,
|
||||||
debuglist,consts,
|
debuglist,withdebuglist,consts,
|
||||||
importssection,exportssection,
|
importssection,exportssection,
|
||||||
resourcesection,rttilist,
|
resourcesection,rttilist,
|
||||||
resourcestringlist : paasmoutput;
|
resourcestringlist : paasmoutput;
|
||||||
@ -1044,7 +1044,15 @@ uses
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.77 2000-02-09 13:22:42 peter
|
Revision 1.78 2000-02-18 20:53:14 pierre
|
||||||
|
* fixes a stabs problem for functions
|
||||||
|
+ includes a stabs local var for with statements
|
||||||
|
the name is with in lowercase followed by an index
|
||||||
|
for nested with.
|
||||||
|
+ Withdebuglist added because the stabs declarations of local
|
||||||
|
var are postponed to end of function.
|
||||||
|
|
||||||
|
Revision 1.77 2000/02/09 13:22:42 peter
|
||||||
* log truncated
|
* log truncated
|
||||||
|
|
||||||
Revision 1.76 2000/02/03 23:01:45 peter
|
Revision 1.76 2000/02/03 23:01:45 peter
|
||||||
|
@ -43,6 +43,9 @@ interface
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$ifdef GDB}
|
||||||
|
strings,gdb,
|
||||||
|
{$endif GDB}
|
||||||
globtype,systems,
|
globtype,systems,
|
||||||
cobjects,verbose,globals,
|
cobjects,verbose,globals,
|
||||||
symconst,symtable,aasm,types,
|
symconst,symtable,aasm,types,
|
||||||
@ -809,6 +812,14 @@ implementation
|
|||||||
procedure secondwith(var p : ptree);
|
procedure secondwith(var p : ptree);
|
||||||
var
|
var
|
||||||
usetemp,with_expr_in_temp : boolean;
|
usetemp,with_expr_in_temp : boolean;
|
||||||
|
{$ifdef GDB}
|
||||||
|
withstartlabel,withendlabel : pasmlabel;
|
||||||
|
pp : pchar;
|
||||||
|
mangled_length : longint;
|
||||||
|
|
||||||
|
const
|
||||||
|
withlevel : longint = 0;
|
||||||
|
{$endif GDB}
|
||||||
begin
|
begin
|
||||||
if assigned(p^.left) then
|
if assigned(p^.left) then
|
||||||
begin
|
begin
|
||||||
@ -870,6 +881,28 @@ implementation
|
|||||||
{$ifndef noAllocEdi}
|
{$ifndef noAllocEdi}
|
||||||
ungetregister32(R_EDI);
|
ungetregister32(R_EDI);
|
||||||
{$endif noAllocEdi}
|
{$endif noAllocEdi}
|
||||||
|
{$ifdef GDB}
|
||||||
|
if (cs_debuginfo in aktmoduleswitches) then
|
||||||
|
begin
|
||||||
|
inc(withlevel);
|
||||||
|
getlabel(withstartlabel);
|
||||||
|
getlabel(withendlabel);
|
||||||
|
emitlab(withstartlabel);
|
||||||
|
withdebuglist^.concat(new(pai_stabs,init(strpnew(
|
||||||
|
'"with'+tostr(withlevel)+':'+tostr(symtablestack^.getnewtypecount)+
|
||||||
|
'=*'+p^.left^.resulttype^.numberstring+'",'+
|
||||||
|
tostr(N_LSYM)+',0,0,'+tostr(p^.withreference^.offset)))));
|
||||||
|
mangled_length:=length(aktprocsym^.definition^.mangledname);
|
||||||
|
getmem(pp,mangled_length+50);
|
||||||
|
strpcopy(pp,'192,0,0,'+withstartlabel^.name);
|
||||||
|
if (target_os.use_function_relative_addresses) then
|
||||||
|
begin
|
||||||
|
strpcopy(strend(pp),'-');
|
||||||
|
strpcopy(strend(pp),aktprocsym^.definition^.mangledname);
|
||||||
|
end;
|
||||||
|
withdebuglist^.concat(new(pai_stabn,init(strnew(pp))));
|
||||||
|
end;
|
||||||
|
{$endif GDB}
|
||||||
del_reference(p^.left^.location.reference);
|
del_reference(p^.left^.location.reference);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -878,7 +911,24 @@ implementation
|
|||||||
secondpass(p^.right);
|
secondpass(p^.right);
|
||||||
|
|
||||||
if usetemp then
|
if usetemp then
|
||||||
ungetpersistanttemp(p^.withreference^.offset);
|
begin
|
||||||
|
ungetpersistanttemp(p^.withreference^.offset);
|
||||||
|
{$ifdef GDB}
|
||||||
|
if (cs_debuginfo in aktmoduleswitches) then
|
||||||
|
begin
|
||||||
|
emitlab(withendlabel);
|
||||||
|
strpcopy(pp,'224,0,0,'+withendlabel^.name);
|
||||||
|
if (target_os.use_function_relative_addresses) then
|
||||||
|
begin
|
||||||
|
strpcopy(strend(pp),'-');
|
||||||
|
strpcopy(strend(pp),aktprocsym^.definition^.mangledname);
|
||||||
|
end;
|
||||||
|
withdebuglist^.concat(new(pai_stabn,init(strnew(pp))));
|
||||||
|
freemem(pp,mangled_length+50);
|
||||||
|
dec(withlevel);
|
||||||
|
end;
|
||||||
|
{$endif GDB}
|
||||||
|
end;
|
||||||
|
|
||||||
if with_expr_in_temp then
|
if with_expr_in_temp then
|
||||||
ungetpersistanttemp(p^.left^.location.reference.offset);
|
ungetpersistanttemp(p^.left^.location.reference.offset);
|
||||||
@ -892,7 +942,15 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.71 2000-02-09 18:08:33 jonas
|
Revision 1.72 2000-02-18 20:53:14 pierre
|
||||||
|
* fixes a stabs problem for functions
|
||||||
|
+ includes a stabs local var for with statements
|
||||||
|
the name is with in lowercase followed by an index
|
||||||
|
for nested with.
|
||||||
|
+ Withdebuglist added because the stabs declarations of local
|
||||||
|
var are postponed to end of function.
|
||||||
|
|
||||||
|
Revision 1.71 2000/02/09 18:08:33 jonas
|
||||||
* added regallocs for esi
|
* added regallocs for esi
|
||||||
|
|
||||||
Revision 1.70 2000/02/09 13:22:47 peter
|
Revision 1.70 2000/02/09 13:22:47 peter
|
||||||
@ -971,4 +1029,3 @@ end.
|
|||||||
* array constructor support
|
* array constructor support
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3668,7 +3668,7 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
|
|
||||||
{ define calling EBP as pseudo local var PM }
|
{ define calling EBP as pseudo local var PM }
|
||||||
{ this enables test if the function is a local one !! }
|
{ this enables test if the function is a local one !! }
|
||||||
if assigned(procinfo^.parent) then
|
if assigned(procinfo^.parent) and (lexlevel>normal_function_level) then
|
||||||
exprasmlist^.concat(new(pai_stabs,init(strpnew(
|
exprasmlist^.concat(new(pai_stabs,init(strpnew(
|
||||||
'"parent_ebp:'+voidpointerdef^.numberstring+'",'+
|
'"parent_ebp:'+voidpointerdef^.numberstring+'",'+
|
||||||
tostr(N_LSYM)+',0,0,'+tostr(procinfo^.framepointer_offset)))));
|
tostr(N_LSYM)+',0,0,'+tostr(procinfo^.framepointer_offset)))));
|
||||||
@ -3694,19 +3694,31 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
tostr(N_PSYM)+',0,0,'+tostr(procinfo^.return_offset)))));
|
tostr(N_PSYM)+',0,0,'+tostr(procinfo^.return_offset)))));
|
||||||
end;
|
end;
|
||||||
mangled_length:=length(aktprocsym^.definition^.mangledname);
|
mangled_length:=length(aktprocsym^.definition^.mangledname);
|
||||||
getmem(p,mangled_length+50);
|
getmem(p,2*mangled_length+50);
|
||||||
strpcopy(p,'192,0,0,');
|
strpcopy(p,'192,0,0,');
|
||||||
strpcopy(strend(p),aktprocsym^.definition^.mangledname);
|
strpcopy(strend(p),aktprocsym^.definition^.mangledname);
|
||||||
|
if (target_os.use_function_relative_addresses) then
|
||||||
|
begin
|
||||||
|
strpcopy(strend(p),'-');
|
||||||
|
strpcopy(strend(p),aktprocsym^.definition^.mangledname);
|
||||||
|
end;
|
||||||
exprasmlist^.concat(new(pai_stabn,init(strnew(p))));
|
exprasmlist^.concat(new(pai_stabn,init(strnew(p))));
|
||||||
{list^.concat(new(pai_stabn,init(strpnew('192,0,0,'
|
{list^.concat(new(pai_stabn,init(strpnew('192,0,0,'
|
||||||
+aktprocsym^.definition^.mangledname))));
|
+aktprocsym^.definition^.mangledname))));
|
||||||
p[0]:='2';p[1]:='2';p[2]:='4';
|
p[0]:='2';p[1]:='2';p[2]:='4';
|
||||||
strpcopy(strend(p),'_end');}
|
strpcopy(strend(p),'_end');}
|
||||||
freemem(p,mangled_length+50);
|
strpcopy(p,'224,0,0,'+aktexit2label^.name);
|
||||||
|
if (target_os.use_function_relative_addresses) then
|
||||||
|
begin
|
||||||
|
strpcopy(strend(p),'-');
|
||||||
|
strpcopy(strend(p),aktprocsym^.definition^.mangledname);
|
||||||
|
end;
|
||||||
|
exprasmlist^.concatlist(withdebuglist);
|
||||||
exprasmlist^.concat(new(pai_stabn,init(
|
exprasmlist^.concat(new(pai_stabn,init(
|
||||||
strpnew('224,0,0,'+aktexit2label^.name))));
|
strnew(p))));
|
||||||
{ strpnew('224,0,0,'
|
{ strpnew('224,0,0,'
|
||||||
+aktprocsym^.definition^.mangledname+'_end'))));}
|
+aktprocsym^.definition^.mangledname+'_end'))));}
|
||||||
|
freemem(p,2*mangled_length+50);
|
||||||
end;
|
end;
|
||||||
{$endif GDB}
|
{$endif GDB}
|
||||||
exprasmlist:=oldexprasmlist;
|
exprasmlist:=oldexprasmlist;
|
||||||
@ -3740,7 +3752,15 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.81 2000-02-10 23:44:43 florian
|
Revision 1.82 2000-02-18 20:53:14 pierre
|
||||||
|
* fixes a stabs problem for functions
|
||||||
|
+ includes a stabs local var for with statements
|
||||||
|
the name is with in lowercase followed by an index
|
||||||
|
for nested with.
|
||||||
|
+ Withdebuglist added because the stabs declarations of local
|
||||||
|
var are postponed to end of function.
|
||||||
|
|
||||||
|
Revision 1.81 2000/02/10 23:44:43 florian
|
||||||
* big update for exception handling code generation: possible mem holes
|
* big update for exception handling code generation: possible mem holes
|
||||||
fixed, break/continue/exit should work always now as expected
|
fixed, break/continue/exit should work always now as expected
|
||||||
|
|
||||||
|
@ -357,6 +357,7 @@ implementation
|
|||||||
codesegment:=new(paasmoutput,init);
|
codesegment:=new(paasmoutput,init);
|
||||||
bsssegment:=new(paasmoutput,init);
|
bsssegment:=new(paasmoutput,init);
|
||||||
debuglist:=new(paasmoutput,init);
|
debuglist:=new(paasmoutput,init);
|
||||||
|
withdebuglist:=new(paasmoutput,init);
|
||||||
consts:=new(paasmoutput,init);
|
consts:=new(paasmoutput,init);
|
||||||
rttilist:=new(paasmoutput,init);
|
rttilist:=new(paasmoutput,init);
|
||||||
importssection:=nil;
|
importssection:=nil;
|
||||||
@ -383,6 +384,7 @@ implementation
|
|||||||
dispose(bsssegment,done);
|
dispose(bsssegment,done);
|
||||||
dispose(datasegment,done);
|
dispose(datasegment,done);
|
||||||
dispose(debuglist,done);
|
dispose(debuglist,done);
|
||||||
|
dispose(withdebuglist,done);
|
||||||
dispose(consts,done);
|
dispose(consts,done);
|
||||||
dispose(rttilist,done);
|
dispose(rttilist,done);
|
||||||
if assigned(importssection) then
|
if assigned(importssection) then
|
||||||
@ -447,7 +449,15 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.56 2000-02-09 13:22:53 peter
|
Revision 1.57 2000-02-18 20:53:14 pierre
|
||||||
|
* fixes a stabs problem for functions
|
||||||
|
+ includes a stabs local var for with statements
|
||||||
|
the name is with in lowercase followed by an index
|
||||||
|
for nested with.
|
||||||
|
+ Withdebuglist added because the stabs declarations of local
|
||||||
|
var are postponed to end of function.
|
||||||
|
|
||||||
|
Revision 1.56 2000/02/09 13:22:53 peter
|
||||||
* log truncated
|
* log truncated
|
||||||
|
|
||||||
Revision 1.55 2000/01/16 22:17:11 peter
|
Revision 1.55 2000/01/16 22:17:11 peter
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
unit parser;
|
unit parser;
|
||||||
|
|
||||||
{ Use exception catching so the compiler goes futher after a Stop }
|
{ Use exception catching so the compiler goes futher after a Stop }
|
||||||
|
{$ifndef NOUSEEXCEPT}
|
||||||
{$ifdef i386}
|
{$ifdef i386}
|
||||||
{$define USEEXCEPT}
|
{$define USEEXCEPT}
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -35,6 +36,7 @@ unit parser;
|
|||||||
{$undef USEEXCEPT}
|
{$undef USEEXCEPT}
|
||||||
{$endif}
|
{$endif}
|
||||||
{$endif}
|
{$endif}
|
||||||
|
{$endif ndef NOUSEEXCEPT}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
@ -258,6 +260,7 @@ unit parser;
|
|||||||
oldcodesegment,
|
oldcodesegment,
|
||||||
oldexprasmlist,
|
oldexprasmlist,
|
||||||
olddebuglist,
|
olddebuglist,
|
||||||
|
oldwithdebuglist,
|
||||||
oldconsts : paasmoutput;
|
oldconsts : paasmoutput;
|
||||||
oldasmsymbollist : pasmsymbollist;
|
oldasmsymbollist : pasmsymbollist;
|
||||||
{ akt.. things }
|
{ akt.. things }
|
||||||
@ -313,6 +316,7 @@ unit parser;
|
|||||||
oldbsssegment:=bsssegment;
|
oldbsssegment:=bsssegment;
|
||||||
oldcodesegment:=codesegment;
|
oldcodesegment:=codesegment;
|
||||||
olddebuglist:=debuglist;
|
olddebuglist:=debuglist;
|
||||||
|
oldwithdebuglist:=withdebuglist;
|
||||||
oldconsts:=consts;
|
oldconsts:=consts;
|
||||||
oldrttilist:=rttilist;
|
oldrttilist:=rttilist;
|
||||||
oldexprasmlist:=exprasmlist;
|
oldexprasmlist:=exprasmlist;
|
||||||
@ -498,6 +502,7 @@ unit parser;
|
|||||||
codesegment:=oldcodesegment;
|
codesegment:=oldcodesegment;
|
||||||
consts:=oldconsts;
|
consts:=oldconsts;
|
||||||
debuglist:=olddebuglist;
|
debuglist:=olddebuglist;
|
||||||
|
withdebuglist:=oldwithdebuglist;
|
||||||
importssection:=oldimports;
|
importssection:=oldimports;
|
||||||
exportssection:=oldexports;
|
exportssection:=oldexports;
|
||||||
resourcesection:=oldresource;
|
resourcesection:=oldresource;
|
||||||
@ -594,7 +599,15 @@ unit parser;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.100 2000-02-14 20:58:44 marco
|
Revision 1.101 2000-02-18 20:53:15 pierre
|
||||||
|
* fixes a stabs problem for functions
|
||||||
|
+ includes a stabs local var for with statements
|
||||||
|
the name is with in lowercase followed by an index
|
||||||
|
for nested with.
|
||||||
|
+ Withdebuglist added because the stabs declarations of local
|
||||||
|
var are postponed to end of function.
|
||||||
|
|
||||||
|
Revision 1.100 2000/02/14 20:58:44 marco
|
||||||
* Basic structures for new sethandling implemented.
|
* Basic structures for new sethandling implemented.
|
||||||
|
|
||||||
Revision 1.99 2000/02/09 13:22:55 peter
|
Revision 1.99 2000/02/09 13:22:55 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user