[PATCH]Add --style switch to binutils

Ken Block block@zk3.dec.com
Fri Jun 23 06:57:00 GMT 2000

Philippe De Muyter wrote:

> Ken Block wrote :
> > If people would prefer --style be --demangler, I have no objections.
> > --style is what is used in H.J. Lu's binutils. Previously, it was
> > --lang.
> >
> > There is another switch --demangler which takes the name of a shared
> > object and an entry point. These are used to dynamically load a
> > demangler from a shared object.
> >
> > [...]
> >
> > DJ Delorie wrote:
> >
> > > "--style" sounds like an awfully generic name.  How about
> > > "--demangler" instead?
> >
> How about --mangling-style ?

Either is fine with me. Basically, there are currently 3 switches for
demangling under H.J's binutils.

--[no-]demangle -- enables/disables demangling

--style -- set mangling style to a known demangling style like GNU, HP,

--demangler -- uses a demangler that is external to the tool to perform

So for example, to say I want to use "nm" and have it demangle using the
"HP" style, I do:

nm --demangle --style=HP.

I proposed to H.J. that we consolidate the --style swtich and the
--demangler switch and have the argument be overloaded. That if you say
"--demangler=HP" you get the HP demangler, but if you say
"--demangler=foo:bar" you get the external demangler looked up as foo
with the parameter bar.

I was wondering if it was further possible to fold the --demangle and the
--demangler switch together such that I could say "nm --demangle" and get
the default demangling or "nm --demangle=HP". Is this possible to do
within getopt? If I say "nm --demangle t.o", I do not want t.o be
interpreted as the optional argument. My understand of getopts is that if
an argument is optional, it must be provided in the --switch=arg form,
--switch form is disallowed. So this should work. So the documentation
should become:

--[no-]demangle[=<style>|<dso:function>] -- enable/disable demangling and
allows control over the demangling style using either a known style or an
external demangler. The default demangling style is GNU.

Phillippe, D.J. , Doug, since you guys objected to --style, would this be

More information about the Binutils mailing list