Merge branch 'martin-entry-pc' into 'main'

DW_AT_entry_pc for methods in (artefical) copy declaration of structures

See merge request freepascal.org/fpc/source!448
This commit is contained in:
Martin 2025-04-03 22:26:53 +02:00
commit dd1837b5ba
3 changed files with 15 additions and 2 deletions

View File

@ -2139,6 +2139,15 @@ implementation
current_asmdata.asmlists[al_dwarf_aranges].concat(tai_const.Create_16bit_unaligned(0));
{$endif i8086}
end;
end
else
if (ds_dwarf_fpdebug in current_settings.debugswitches) then
begin
if use_dotted_functions then
procentry := '.' + def.mangledname
else
procentry := def.mangledname;
append_labelentry(DW_AT_entry_pc,current_asmdata.RefAsmSymbol(procentry,AT_FUNCTION));
end;
{ Don't write the funcretsym explicitly, it's also in the

View File

@ -278,7 +278,10 @@ interface
{ though, they support and use dwarf debug information in the }
{ final executable file, they expect LINNUM records in the }
{ object modules for the line number information. }
ds_dwarf_omf_linnum
ds_dwarf_omf_linnum,
{ generate additional DWARF info for FpDebug. }
{ Add DW_AT_entry_pc in repeated (artifical) class info }
ds_dwarf_fpdebug
);
tdebugswitches = set of tdebugswitch;
@ -459,7 +462,7 @@ interface
);
DebugSwitchStr : array[tdebugswitch] of string[22] = ('',
'DWARFSETS','STABSABSINCLUDES','DWARFMETHODCLASSPREFIX','DWARFCPP','DWARFOMFLINNUM');
'DWARFSETS','STABSABSINCLUDES','DWARFMETHODCLASSPREFIX','DWARFCPP','DWARFOMFLINNUM','DWARFFPDEBUG');
TargetSwitchStr : array[ttargetswitch] of ttargetswitchinfo = (
(name: ''; hasvalue: false; isglobal: true ; define: ''),

View File

@ -4180,6 +4180,7 @@ A*2CV<x>_Set section threadvar model to <x>
*g2gm_Generate Microsoft CodeView debug information (experimental)
*g2go<x>_Set debug information options
*g3godwarfcpp_ Simulate C++ debug information in DWARF
*g3godwarffpdebug_ Generate additional DWARF debug information for FpDebug
*g3godwarfmethodclassprefix_ Prefix method names in DWARF with class name
*g3godwarfomflinnum_ Generate line number information in OMF LINNUM records in MS LINK format in addition to the DWARF debug information (Open Watcom Debugger/Linker compatibility)
*g3godwarfsets_ Enable DWARF 'set' type debug information (breaks gdb < 6.5)