|
|
jacob navia said:
> Flash Gordon wrote:
>> jacob navia wrote, On 28/03/08 21:39:
<snip>
>
>>> 5) Find out into which function the return address points to.
>>>
>>> 6) Is that the function "main"?
>>>
>>> 7) If not, get the next frame pointer and go to (2)
>>
>> A problem if main was called recursively.
>>
>
> No. As I explained to Mr Heathfield, that raised the same objection,
> my algorithm just stops at the first possible recursive call of main
> It doesn't fail at all. It will not follow recursive calls to "main".
>
> That is all.
>
> Obviously, calling "main" recurisvely is very popular here.
Well, not really, but recursive main *is* legal. It seems to me that a
non-portable solution would be free to learn main's caller (e.g. _startup,
or whatever), and probe for that instead. This would allow recursive main
calls to be backtraced properly.
<snip>
--
Richard Heathfield <http://www.cpax.org.uk>
Email: - www">http://www. +rjh@
Google users: < www.cpax.org.uk/prg/writings/googly.php">http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
|
|