This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][RFC] Malloc-less demangler interface
Ian Lance Taylor wrote:
>> If so, then I understand the goal, though, frankly, I'd just write the
>> mangled name, since if the program is dying a horrible death, you may
>> not have much of anything working reliably at this point. Or, at least,
>> I'd write the mangled name first, before trying bravely to demangle it. :-)
>
> Sure, but vterminate currently tries to demangle the name. That means
> that if it winds up getting called because the heap is corrupted, we
> are in great pain.
Right. I believe that I complained on the libstdc++ list about this
ages ago. :-) In general, my argument was that the default terminate
handler had no business trying to write anything out at all, and that
the user should have to explicitly request that behavior (by, for
example, linking with a special library, or setting a terminate handler
explicitly). Anyhow... :-)
> Another point: it's trivial to use a callback interface to implement
> an allocation interface, but the reverse is not true.
Yes, that's true. There are other tradeoffs, but I'm not worried. Now
that I understand the desired use case, I'm happy. :-)
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713