This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: inline abort


>>>>> "John" == John Carr <jfc@MIT.EDU> writes:

    >> It means that we can't put a breakpoint on abort when debugging
    >> the compiler.

    John> It means you don't need to put a breakpoint on abort: the
    John> process stops on a trap and the debugger takes control.

    >> And gdb's handling of random trap instructions may be less than
    >> ideal on some platforms

    John> It works fine on Solaris.  I did see a debugger have
    John> problems on a different system a few years ago, probably
    John> because it used the same instruction to implement
    John> breakpoints.

    >> Or a different signal may be raised than SIGABRT when we hit
    >> one of these trap instructions.

    John> That is true.  You get a choice of several signals on
    John> Solaris but I don't think SIGABRT is one of them.  -ansi
    John> should disable use of trap calls to implement abort on
    John> systems where trap does not generate the correct signal.

I don't think it is a good idea to have this change enabled by
default.  Using -ansi to get ANSI behavior is reasonable, but this is
a major change in behavior.  Usually, without -ansi either some GNU
extensions are accepted that would't be, but the cases in which major
behavior is altered are rare.

Is it possible to do this "at user-level" with a macro defining
my_abort () to be asm ( "..." ) the asm is the correct trap
instruction?  Perhaps that doesn't allow some of the optimizations you
desire.  If it doesn't, I see the point of your patch, but I think it
should be off by default.

-- 
Mark Mitchell <mmitchell@usa.net>
http://home.earthlink.net/~mbmitchell
Consulting Services Available


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]