On Fri, Dec 06, 2013 at 03:26:53PM -0800, Walter Bright wrote: > On 5/27/2013 11:14 AM, Peter Alexander wrote: > >The symbols typically contain a lot of repeated sub strings. Perhaps > >there is a better mangling scheme that encodes it with some kind of > >prefix tree? > > Rather than a new scheme, a simple and effective approach is to > compress using lzw. Lzw is nicely reversible, too, though the symbols > will look like tty noise in the linker maps and the debugger. > > One approach is to lzw them only if they exceed a certain length, and > to leave a prefix that makes some sense to the user, like the function > name.
Looking like noise shouldn't be a problem, as long as ddemangle is updated to be able to interpret them. I doubt very many people can demangle D symbols in their head anyway; most would use ddemangle. Leaving the function name in is a good compromise, though not strictly necessary if ddemangle can interpret the lzw noise. On that note, core.demangle seriously needs to be able to demangle *all* mangled symbols (like module ctors, typeinfos, vtables, etc.), not just function symbols. Running `nm program | ddemangle` still leaves about half the symbols mangled, which is annoying when you're trying to figure out what those symbols are referring to. T -- Marketing: the art of convincing people to pay for what they didn't need before which you can't deliver after.
