IIRC, the Include-Directive should always work, irrespective of Debug-Infos yes/no, since it's resolved at compile-time
Furthermore I believe %file% and %line% have been available since time immemorial although some of the more detailed expansions are more recent.
Simone's suggestion of Get_Caller_Addr() etc. have been available since at least v2.2.2, although referring to the RTL sources their presence appears to be announced by platform-specific defines.
I've been habitually using this sort of thing for a while, particularly in e.g. a recursive-descent parser:
(* Parse the PEC stitchlist section.
*)
function pec_stitchListSubsection(): boolean;
const
thisName= 'pec_stitchListSubsection()';
begin
{$ifdef HAS_CURRENTROUTINE }
Assert(thisName = {$I %CURRENTROUTINE%} + '()', 'Internal error: bad name in ' +
{$I %CURRENTROUTINE%} + '()');
{$endif HAS_CURRENTROUTINE }
result := false;
pushRule(thisName);
...
However the %CURRENTROUTINE% expansion is only available from 3.2.0 onwards, so at the start of the unit (or in a common .inc file) I have something like
{$undef HAS_CURRENTROUTINE }
{$if FPC_FULLVERSION >= 030200 } (* Requires FPC 2.2.4 minimum *)
{$define HAS_CURRENTROUTINE } (* Requires FPC 3.2.0 minimum *)
{$assertions on } (* Make sure name checks are operative *)
{$endif FPC_FULLVERSION }
which requires a minimum of 2.2.4... I'd be surprised if anybody is still running anything that old unless they're testing GTK1 compatibility.
MarkMLl