>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:
Tom> The hash code idea seems a little weird to me, but the name
Tom> canonicalization problem seems important to solve.
Daniel> FWIW, I think this is a good argument for handling this as a GDB
Daniel> caching extension rather than a DWARF extension. I can't imagine any
Daniel> way to stably standardize this. GDB is designed to be, if not
Daniel> completely robust, at least flexible w.r.t. future changes in the
Daniel> demangler's canonicalized output.
I think it would still be ok. We would specify the canonical form as
part of the extension, and it would be up to compilers, and gdb, to
correctly implement it. AFAICT it can be specified entirely in terms of
the source language of the CU.
In terms of our own demangler, if we wanted to change its output -- say,
we make some tweak to make it prettier somehow -- we could add a "DWARF"
demangle style that would preserve compatibility.
We don't need to ever display the contents of this index to users. It
is purely an internal detail. gdb (and presumably any debugger) needs
to canonicalize the table entries, so why not have the compiler generate
things already canonicalized, to save a step?
If we need to change the canonicalization for some other reason, say
because C++ adds new features, we can bump the version number in
.debug_gnu_index and specify a new canonical form.
Tom