On 8 Dec 2006 22:13:36 -0800, "santosh" <sa*********@gmail.comwrote:
>David Willoughby wrote:
>I'm attempting to catch bugs in my program using signal.h with sigsegv.
now i know when i'm in gdb i can catch bugs but is there any variable
that stores like the file that caused the bug and possible calling
procs? or would that only be left to something with gdb.
The standard macros __FILE__ and __LINE__ may do what you want. For
more you'll have to use implementation specific extensions.
I can't think of any way the standard macros __FILE__ and __LINE__
could help in the general case of a SIGSEGV signal.
Moreover, saying that "implementation-specific extensions" could help
in the general case implies to me *compiler* implementation-specific
extensions. But more likely than not, it's things like debuggers,
which are beyond the scope of the ANSI/ISO C standard--which is what
we discuss here--that will help the OP.
I think the spirit of your post was that the OP should look for help
in another, more appropriate newsgroup. If so, indeed the OP should
(and find out, that, that would only be left to something with gdb, as
the OP surmised :^).
Best regards
--
jay