mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-19 05:50:28 +02:00
* fixed the size of class instances (instance size instead of
sizeof(pointer)) * fixed the inheritance definition of classes (refer the structural definition of the parent class rather than the associated pointer type when indicating the inheritance) git-svn-id: trunk@6543 -
This commit is contained in:
parent
ac22bd4474
commit
f81303874f
@ -644,6 +644,8 @@ implementation
|
|||||||
if not assigned(def.typesym) then
|
if not assigned(def.typesym) then
|
||||||
internalerror(200610011);
|
internalerror(200610011);
|
||||||
def.dwarf_lab:=current_asmdata.RefAsmSymbol(make_mangledname('DBG',def.owner,symname(def.typesym)));
|
def.dwarf_lab:=current_asmdata.RefAsmSymbol(make_mangledname('DBG',def.owner,symname(def.typesym)));
|
||||||
|
if is_class_or_interface_or_dispinterface(def) then
|
||||||
|
tobjectdef(def).dwarf_struct_lab:=current_asmdata.RefAsmSymbol(make_mangledname('DBG2',def.owner,symname(def.typesym)));
|
||||||
def.dbg_state:=dbg_state_written;
|
def.dbg_state:=dbg_state_written;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -655,15 +657,18 @@ implementation
|
|||||||
(def.owner.iscurrentunit) then
|
(def.owner.iscurrentunit) then
|
||||||
begin
|
begin
|
||||||
def.dwarf_lab:=current_asmdata.DefineAsmSymbol(make_mangledname('DBG',def.owner,symname(def.typesym)),AB_GLOBAL,AT_DATA);
|
def.dwarf_lab:=current_asmdata.DefineAsmSymbol(make_mangledname('DBG',def.owner,symname(def.typesym)),AB_GLOBAL,AT_DATA);
|
||||||
|
if is_class_or_interface_or_dispinterface(def) then
|
||||||
|
tobjectdef(def).dwarf_struct_lab:=current_asmdata.DefineAsmSymbol(make_mangledname('DBG2',def.owner,symname(def.typesym)),AB_GLOBAL,AT_DATA);
|
||||||
include(def.defstates,ds_dwarf_dbg_info_written);
|
include(def.defstates,ds_dwarf_dbg_info_written);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
begin
|
||||||
{ The pointer typecast is needed to prevent a problem with range checking
|
{ The pointer typecast is needed to prevent a problem with range checking
|
||||||
on when the typecast is changed to 'as' }
|
on when the typecast is changed to 'as' }
|
||||||
current_asmdata.getdatalabel(TAsmLabel(pointer(def.dwarf_lab)));
|
current_asmdata.getdatalabel(TAsmLabel(pointer(def.dwarf_lab)));
|
||||||
|
if is_class_or_interface_or_dispinterface(def) then
|
||||||
if def.dbg_state=dbg_state_used then
|
current_asmdata.getdatalabel(TAsmLabel(pointer(tobjectdef(def).dwarf_struct_lab)));
|
||||||
deftowritelist.Add(def);
|
end;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -672,9 +677,11 @@ implementation
|
|||||||
on when the typecast is changed to 'as' }
|
on when the typecast is changed to 'as' }
|
||||||
{ addrlabel instead of datalabel because it must be a local one }
|
{ addrlabel instead of datalabel because it must be a local one }
|
||||||
current_asmdata.getaddrlabel(TAsmLabel(pointer(def.dwarf_lab)));
|
current_asmdata.getaddrlabel(TAsmLabel(pointer(def.dwarf_lab)));
|
||||||
|
if is_class_or_interface_or_dispinterface(def) then
|
||||||
|
current_asmdata.getaddrlabel(TAsmLabel(pointer(tobjectdef(def).dwarf_struct_lab)));
|
||||||
|
end;
|
||||||
if def.dbg_state=dbg_state_used then
|
if def.dbg_state=dbg_state_used then
|
||||||
deftowritelist.Add(def);
|
deftowritelist.Add(def);
|
||||||
end;
|
|
||||||
defnumberlist.Add(def);
|
defnumberlist.Add(def);
|
||||||
end;
|
end;
|
||||||
result:=def.dwarf_lab;
|
result:=def.dwarf_lab;
|
||||||
@ -2571,11 +2578,11 @@ implementation
|
|||||||
if assigned(def.objname) then
|
if assigned(def.objname) then
|
||||||
append_entry(DW_TAG_structure_type,true,[
|
append_entry(DW_TAG_structure_type,true,[
|
||||||
DW_AT_name,DW_FORM_string,def.objname^+#0,
|
DW_AT_name,DW_FORM_string,def.objname^+#0,
|
||||||
DW_AT_byte_size,DW_FORM_udata,def.size
|
DW_AT_byte_size,DW_FORM_udata,tobjectsymtable(def.symtable).datasize
|
||||||
])
|
])
|
||||||
else
|
else
|
||||||
append_entry(DW_TAG_structure_type,true,[
|
append_entry(DW_TAG_structure_type,true,[
|
||||||
DW_AT_byte_size,DW_FORM_udata,def.size
|
DW_AT_byte_size,DW_FORM_udata,tobjectsymtable(def.symtable).datasize
|
||||||
]);
|
]);
|
||||||
finish_entry;
|
finish_entry;
|
||||||
if assigned(def.childof) then
|
if assigned(def.childof) then
|
||||||
@ -2586,6 +2593,12 @@ implementation
|
|||||||
]);
|
]);
|
||||||
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_plus_uconst)));
|
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_plus_uconst)));
|
||||||
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_uleb128bit(0));
|
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_uleb128bit(0));
|
||||||
|
if (def.childof.dbg_state=dbg_state_unused) then
|
||||||
|
def.childof.dbg_state:=dbg_state_used;
|
||||||
|
def_dwarf_lab(def.childof);
|
||||||
|
if is_class_or_interface_or_dispinterface(def) then
|
||||||
|
append_labelentry_ref(DW_AT_type,def.childof.dwarf_struct_lab)
|
||||||
|
else
|
||||||
append_labelentry_ref(DW_AT_type,def_dwarf_lab(def.childof));
|
append_labelentry_ref(DW_AT_type,def_dwarf_lab(def.childof));
|
||||||
finish_entry;
|
finish_entry;
|
||||||
end;
|
end;
|
||||||
@ -2595,9 +2608,6 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
var
|
|
||||||
obj : tasmlabel;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
case def.objecttype of
|
case def.objecttype of
|
||||||
odt_cppclass,
|
odt_cppclass,
|
||||||
@ -2608,16 +2618,15 @@ implementation
|
|||||||
odt_dispinterface,
|
odt_dispinterface,
|
||||||
odt_class:
|
odt_class:
|
||||||
begin
|
begin
|
||||||
if not(tf_dwarf_relative_addresses in target_info.flags) then
|
|
||||||
current_asmdata.getdatalabel(obj)
|
|
||||||
else
|
|
||||||
current_asmdata.getaddrlabel(obj);
|
|
||||||
{ implicit pointer }
|
{ implicit pointer }
|
||||||
append_entry(DW_TAG_pointer_type,false,[]);
|
append_entry(DW_TAG_pointer_type,false,[]);
|
||||||
append_labelentry_ref(DW_AT_type,obj);
|
append_labelentry_ref(DW_AT_type,def.dwarf_struct_lab);
|
||||||
finish_entry;
|
finish_entry;
|
||||||
|
|
||||||
current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(obj,0));
|
if not(tf_dwarf_relative_addresses in target_info.flags) then
|
||||||
|
current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create_global(def.dwarf_struct_lab,0))
|
||||||
|
else
|
||||||
|
current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(def.dwarf_struct_lab,0));
|
||||||
doappend;
|
doappend;
|
||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
|
@ -224,6 +224,7 @@ interface
|
|||||||
|
|
||||||
tobjectdef = class(tabstractrecorddef)
|
tobjectdef = class(tabstractrecorddef)
|
||||||
public
|
public
|
||||||
|
dwarf_struct_lab : tasmsymbol;
|
||||||
childof : tobjectdef;
|
childof : tobjectdef;
|
||||||
childofderef : tderef;
|
childofderef : tderef;
|
||||||
objname,
|
objname,
|
||||||
|
Loading…
Reference in New Issue
Block a user