On Mon, May 21, 2012 at 12:18 PM, Richard Guenther
<richard.guent...@gmail.com> wrote:
> On Sun, May 20, 2012 at 9:10 PM, Diego Novillo <dnovi...@google.com> wrote:
>> On 12-05-20 13:59 , Richard Henderson wrote:
>>>
>>> On 05/18/2012 04:48 PM, Diego Novillo wrote:
>>>>
>>>> We can do this in trunk today using a variant of Lawrence's original
>>>> patch (http://gcc.gnu.org/ml/gcc-patches/2011-09/msg01649.html). This
>>>> uses no C++ features, though it weakens type checking by removing away
>>>> constness.
>>>>
>>>> In the cxx-conversion branch, we can use overloads, which will DTRT
>>>> with const.
>>>>
>>>> My question is, what do folks prefer?
>>>>
>>>> a) The trunk patch today, using no C++ features.
>>>> b) Wait for the cxx-conversion variant?
>>>
>>>
>>> Surely (check(t), t) also works, and also strt wrt const.
>>
>>
>> My concern with (check(t), t) is that it evaluates 't' twice.  It may not be
>> a big deal, however.  In which case, I'm OK with that alternative.
>
> Hum.  A source of possibly nasty errors.
>
> I'd like to avoid using templates here though.  Going with two overloads
> for each function sounds like the best solution to me, thus delay the
> change to cxx-switch time.
>
> What's the effect on bootstrap times?  Remember we build stage1 with -O0
> and checking enabled always ...

Btw, as of doing this all for the sake of debuggability of GCC - for debugging
you do _not_ want to have gdb invoke the checking functions, because then
you ICE in the inferior if you mis-type.  Instead ideally gdb would use the
non-checking variant or even better, diagnose misuse itself (which means
using a python implementation rather than the gcc macro or an inferior call).

So - why not provide proper (python) implementations of the various
accessors in .gdbinit?

Richard.

> Richard.
>
>>
>> Diego.
>>

Reply via email to