[fpc-pascal] Get all caller adresses of a procedure/function

Martin lazarus at mfriebe.de
Mon Aug 6 22:57:42 CEST 2012


On 06/08/2012 21:39, Rainer Stratmann wrote
> Can you explain it more?
> I want not search through the sourcecode, because it makes it less easy.
How does an address like $040012a help you find the source?

> All I need is all caller adresses of p1 in the program.
> Or an incremented counter at compiletime.
> Both seems impossible by now.
>
> If p1 is called then I can see which snippet was not yet called.
> If the compilerincremented counter at the end is 500, then I need 500 snippet
> entries and I can see which entry already was called by the program during
> execution.
>

I am still trying to understand what exactly you try to archive.

What I understand sofar:

-  your program has a fixed amount of text snippets in a given language
   QUESTION: are those snippets unique? Or can there be 2 individual 
snippets, that have the same text, but must be treated as different?
-  you want to implement a method that translates them
- you want to ensure this method was called exactly (or is it at least?) 
once, for each snippet.

For some reason that I do not understand yet, you need a unique 
identifier for each snippet.

Well if the text of the snippets is unique, then you can use the text 
itself.
So instead of using $040012a as token, you can use 'hello world'

----------
That is, I still do not see, why you go this way at all.
You must have a list of all translations somewhere, and somehow you 
translate each snippet. For updating translations, you can
1) add each snippet that has no translation to a list
2) mark each translation, once it was used, and when the app finishes 
list all translations that where not used.

---
Or explain again what you try to do?





More information about the fpc-pascal mailing list