bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/1437] c++filt no longer works with stdin


From: hjl at lucon dot org
Subject: [Bug binutils/1437] c++filt no longer works with stdin
Date: 11 Oct 2005 16:18:40 -0000

------- Additional Comments From hjl at lucon dot org  2005-10-11 16:18 -------
Subject: Re:  New: c++filt no longer works with stdin

On Tue, Oct 11, 2005 at 01:43:57PM +0100, Nick Clifton wrote:
> Hi HJ,
> 
> >address@hidden testsuite]$ cat foo.s
> >        .type   _Z1fv, @function
> >address@hidden testsuite]$
> >/export/build/gnu/binutils-import/build-i686-linux/binutils/cxxfilt < foo.s
> >.type
> >f()
> >function
> >address@hidden testsuite]$ /usr/bin/c++filt < foo.s
> >        .type   f(), @function
> >
> 
> However, decoding these definitions on the command line using the old 
> c++filt does not work properly either:
> 
>   % cxxfilt .type _Z1fv, @function
>   .type
>   _Z1fv,
>   @function
> 
> >Those special handling for `.', `$' and `_' used to be for stdin only. 
> > I think it makes some sense since they are added to assembly code.
> 
> But users can easily look in assembly code, find a mangled name and then 
> try to pass it to c++filt on the command line, expecting to see the 
> demangled name.  This is why I feel that c++filt should have the same 
> behaviour regardless of where it obtains the mangled names.
> 
> I agree that when it is reading from stdin c++filt should preserve the 
> whitespace of its input, so that definitely does need fixing.
> 
> >The reason for
> >
> >  /* For command line args, also try to demangle type encodings.  */
> >  result = cplus_demangle (mangled_name, flags | DMGL_TYPES);
> >
> >is that the assembly code may have
> >
> >.section        .eh_frame,"a",@progbits
> >.ident  "GCC: (GNU) 4.1.0 20051007 (experimental)"
> 
> Ok - I also agree that demangling types by default is a bad idea.  But I 
> still believe that it ought to be possible to demangle them, even when 
> the input comes from stdin.
> 
> So please could you consider the attached patch.  It does three things:
> 
>   * Makes type demangling no be enabled by default (for either stdin or 
> the command line).
> 
>   * Copies the whitespace read from stdin to stdout, preserving the 
> formating of the input whilst demangling its contents.
> 
>   * Updates the documentation to describe why there is a difference 
> between the demangling of names read on the command line and names read 
> from the standard input.
> 

It works for me.

Thanks.


H.J.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=1437

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]