[fpc-pascal] Re: Get all caller adresses of a given function/procedure before executing

Rainer Stratmann RainerStratmann at t-online.de
Wed Aug 15 14:49:04 CEST 2012


Am Wednesday 15 August 2012 14:13:41 schrieb Sven Barth:
> Am 15.08.2012 10:48 schrieb "Rainer Stratmann" <RainerStratmann at t-online.de
>
> > > While this may all be very well known to you, I would ask you to step
> > > back and consider it: having a detached look at it may lead to a better
> > > choice.
> >
> > For me it would be interesting to know how dxgettext gets the snippet
> > information from the program code...!
>
> It scans the source beforehand and looks for resourcestrings and
> additionally for string constants embedded in a function call to "_()"
> (which is their translation function). It also allows to scan DFM files.

If the compiler would simply store the 2 informations (caller adress, pointer 
to the pchar) in a list this scan beforehand would not be necessary anymore 
like in my solution.

I would call this function rs( s : pchar ) because it has to be short.
if there is a rs() in the program the compiler stores the caller adress 
(unique handle) and the pointer to the pchar in a list.

That would be an advantage for freepascal if providing this information native 
and not by some kind of hack like I do now.
Then also the compatible/portable discussion would have an end.
And the jokes about try to make it more difficult to search through the 
opcodes :-)



More information about the fpc-pascal mailing list