From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,91c5b958fecf5eff X-Google-Attributes: gid103376,public From: kenner@lab.ultra.nyu.edu (Richard Kenner) Subject: Re: GNAT exception traceback Date: 1997/06/18 Message-ID: <5o8eea$q7e$1@news.nyu.edu>#1/1 X-Deja-AN: 249303415 References: <01bc7a82$c57186a0$2a208b82@wd> <33A6A725.3BD0@no.such.com> Organization: New York University Ultracomputer Research Lab Newsgroups: comp.lang.ada Date: 1997-06-18T00:00:00+00:00 List-Id: In article <33A6A725.3BD0@no.such.com> Spam Hater writes: >gcc C has a builtin function (macro?) for the return address. >Someone sent me C that uses this in a loop to get a stack trace. >Note the parameter to __builtin_frame_address - if I remember >right, this allows you to say how high up the stack you want >to go. That's right, but many (if not most) implementations of this builtin are incorrect for non-zero operands. As you point out, implementing this function for arbitrary values is equivalent to knowing how to do a full traceback, which is a very hard task. These builtins dated back to CISC days when this was straightforward. In GCC 2.8.0, these functions will be involved in part of an exception system that has at least some of this capability, but they are not recommended for use by programmers with other than an argument of zero. They were never documented.