* Only write access-info for properties when the actual underlying method

belongs to an odt_class or odt_helper, because others do not have debug
   info included
This commit is contained in:
Joost van der Sluis 2022-05-22 01:09:41 +02:00 committed by FPK
parent a5cab5c0aa
commit 2950785bd7
2 changed files with 47 additions and 3 deletions

View File

@ -2955,9 +2955,20 @@ implementation
if assigned(accesslist.procdef) then
begin
memberdef := accesslist.procdef;
memberowner := memberdef.owner;
dwarfoffset := (accesslist.procdef as tcpuprocdef).dwarfoffset;
memberdef_or_sym := memberdef;
// Debuginfo for procdefs is only written for members of an odt_helper
// or odt_class. (So, among others, not for interfaces.)
// It is not possible to reference something that is not there, so
// omit te reference.
if Assigned(memberdef.owner.defowner) and (memberdef.owner.defowner.typ=objectdef) and
(tobjectdef(memberdef.owner.defowner).objecttype in [odt_helper, odt_class]) then
begin
if Assigned(tprocdef(memberdef).localst) then
begin
memberowner := memberdef.owner;
dwarfoffset := (accesslist.procdef as tcpuprocdef).dwarfoffset;
memberdef_or_sym := memberdef;
end;
end;
end
// Note that the returned 'dwarfoffset' is not used and not a dwarf-offset
else if get_symlist_sym_offset(accesslist.firstsym, membersym, dwarfoffset) then

View File

@ -0,0 +1,33 @@
{ %OPT=-gw -godwarfproperties }
program tdwarfproperties1;
{$mode objfpc}{$H+}
type
ITestIntf = interface(IUnknown)
function GetCurrent: TObject;
end;
ITestIntf2 = interface(ITestIntf)
property Current2: TObject read GetCurrent;
end;
{ TGenEvaluationIdentifierList }
TGenEvaluationIdentifierList = class(TInterfacedObject, ITestIntf2)
function GetCurrent: TObject;
property Current2: TObject read GetCurrent;
end;
function TGenEvaluationIdentifierList.GetCurrent: TObject;
begin
end;
var
s: ITestIntf;
begin
s := ITestIntf(nil);
end.