Can I turn off the "backtracing" that appears after some gcc errors?
Can I turn off the "backtracing" that appears after some gcc errors?
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
Continuation of this: http://cboard.cprogramming.com/showthread.php?t=106786
You could compile with a custom-built version of glibc, I guess. Other than that, see my other suggestion.
[edit] Why do you want to? Was my guess correct, more or less? [/edit]
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
What is the advantage of doing this, MK27--if that is your real name... which I am betting it is.
What is the advantage of doing this, MK27--if that is your real name... which I am betting it is.
Because the output doesn't tell me much other than that I should learn to use GDB or something. However, if I'm hack debugging by moving a "puts" statement around (which eventually solved my last fiasco), all that scrolling is a drag. That it can't be turned off is UNBELIEVABLE.
regarding my real name -- now that's a secret -- but you're right. Don't tell anyone, I hear they come in multiples!
and thanks dwk for your other suggestion about 2&>/dev/null (I think that's how it's done)
Last edited by MK27; 09-05-2008 at 05:13 PM. Reason: dwk
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
This thread is a few days old, I know...
The only way I can immediately imagine that a backtrace could be printed during a program crash is if the crash signal was trapped by the C library. This would imply that you could prevent the backtrace dump by overriding the crash signal handler. There are several ways a program could crash, the most likely being SIGSEGV, SIGBUS, SIGFPE, or SIGILL. Try resetting these handlers back to their defaults and see if the dumps go away.
Code:#include <signal.h> signal(SIGSEGV, SIG_DFL); signal(SIGBUS, SIG_DFL); signal(SIGFPE, SIG_DFL); signal(SIGILL, SIG_DFL);
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}
thanks brewbuck, i will remember this the next time it bugs me.
I'm a little surprised you have to "imagine" a backtrace occuring, tho, as if it were a strange event? A "double free" will do it with my out-of-the-fedora-7 box gcc 4.12...
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}