Re: How can i read the stack frames of running process?



Mark Bluemel wrote:
harshal wrote:
but my question is that if a function can print its name with
__FUNCTION__
macro then why it can not print its callers name.

The __FUNCTION__ macro is handled by the preprocessor and is simply a textual replacement at compile time. It's not (terribly) difficult for the preprocessor to track which function it's processing at a time.

I can't find any mention of __FUNCTION__ in n1256. I *can* find __func__. Is __FUNCTION__ at all standard?

--
Philip Potter pgp <at> doc.ic.ac.uk
.



Relevant Pages

  • Re: How can i read the stack frames of running process?
    ... macro then why it can not print its callers name. ... textual replacement at compile time. ... the preprocessor to track which function it's processing at a time. ...
    (comp.lang.c)
  • Re: How can i read the stack frames of running process?
    ... textual replacement at compile time. ... It's not difficult for the preprocessor to track which function it's processing at a time. ... The guy didn't need to worry about whether the particular macro he was referring to was part of the standard. ...
    (comp.lang.c)
  • Re: Conditional Define
    ... Your preprocessing code will first evaluate a ... >I'm concerned about that fact that this can be determined at compile time, ... It has problems because macros can't expand to other preprocessor ... Dan Pop ...
    (comp.lang.c)
  • Re: detecting 64-bitness inside a program
    ... There's no reason it can't be computed at compile time. ... The semantics of the preprocessor were chosen so that the preprocessor ... could be a fairly simple program external to the C compiler proper. ... the preprocessor knows nothing of sizeof. ...
    (comp.unix.programmer)
  • Re: Conditional Define
    ... > what you ask for is inherently impossible at compile time? ... > The preprocessor is a one-pass device. ... > source multiple times. ...
    (comp.lang.c)