[PATCH][RFC] Malloc-less demangler interface

Gabriel Dos Reis gdr@cs.tamu.edu
Tue Jan 30 00:38:00 GMT 2007

Ian Lance Taylor <iant@google.com> writes:

| Gabriel Dos Reis <gdr@cs.tamu.edu> writes:
| > Paolo Carlini <pcarlini@suse.de> writes:
| > 
| > | PS: sorry for having stated incorrectly the problem at issue in the
| > | PR: isn't about the standard exception classes (available through
| > | <stdexcept>) and constrained in the return value of what(). Instead,
| > | is all about bad_alloc, bad_cast, etc, where the null terminated byte
| > | string is implementation-defined (and could well be demangled). In
| > | short, is a purely libsupc++ issue.
| > 
| > I believe the ABI GCC follows clearly states that what() should return
| > the mangled name.  Do I misunderstand?

To answer my own question: yes.

| I just looked, and I don't see that in the C++ ABI document at
| codesourcery.com.  I don't see any mention of what() at all.  Is there
| a different ABI that describes this?

No, I completely confused what(), from the exception class, with
name() from the type_info class.  Sorry about that.

| If we are permitted to return a general string from
| std::bad_alloc::what(), then it seems that we could trivially create
| that function to return whatever string we find convenient.


-- Gaby

More information about the Gcc-patches mailing list