This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFC: next/finish/etc -vs- exceptions
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 11 Jun 2009 10:45:13 -0400
- Subject: Re: RFC: next/finish/etc -vs- exceptions
- References: <m37hzzzgk7.fsf@fleche.redhat.com> <20090610161204.GB25703@adacore.com> <m3hbyoghit.fsf@fleche.redhat.com>
> It would be nice if we had a flag day and simply converted everything
> to breakpoint_ops. That's usually the best way to ensure that new
> code is written the "right" way (gcc has also had some bad experiences
> with these incomplete transitions).
I tried to convert a few of them a few months back. The issue is
that it's not always trivial, and sometimes the breakpoint_ops model
doesn't fit well for the functionality that you're trying to provide.
That's why I was asking whether you had a look at it, because I am
not sure that it will work. But if it does, it really simplifies
greatly the patch, or at least greatly reduces the number of places
where you touch the code.
> I was under the impression that Ada used longjmp to implement
> exceptions, and so the existing longjmp support should work. (Modulo
> the odd bug or two -- I'm not sure if Pedro's fix for the glibc
> pointer mangling went in or not.)
Actually, we have two possible mechanisms, but I think we prefer the
"Zero Cost Exception" mechanism, which doesn't use setjmp/longjmp
because having an exception handler then costs nothing. We assume
that exceptions are rare occurences, and therefore don't wan't to
spent time setting up a handler if we're not going to use it.
--
Joel