This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/1478: [regression] demangler is_gnu_v3_mangled_ctor, is_gnu_v3_mangled_dtor do not work


>Number:         1478
>Category:       c++
>Synopsis:       [regression] demangler is_gnu_v3_mangled_ctor, is_gnu_v3_mangled_dtor do not work
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 08 08:18:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     mec.gnu@mindspring.com
>Release:        gdb HEAD 2003-12-02 00:00:00 UTC
>Organization:
>Environment:
target = native, host = i686-pc-linux-gnu, osversion = red-hat-8.0
gdb = HEAD 2003-12-02 00:00:00 UTC
gcc = 3.3.2
binutils = 2.14
glibc = 2.2.93-5-rh
gformat = stabs+
glevel = 2
>Description:
Note: I'm filing this PR so that I have a gdb PR to reference when I write up a regression report for gdb.

test script gdb.cp/classes.exp
test program gdb.cp/misc

  (gdb) ptype Foo
  type = class Foo {
    ...
    void Foo(Foo const&);
    void Foo(int, int);
    ...
  }

gdb thinks that Foo::Foo has a return type.
gdb thinks this because cp-demangle.c said so.

The problem happened between 2003-12-01 23:00:00 UTC and 2003-12-02 00:00:00 UTC with this patch:

  2003-11-29  Ian Lance Taylor  <ian@wasabisystems.com>

        * cp-demangle.c (d_demangle): Only return success if we consumed
        the entire demangled string.
        (is_ctor_or_dtor): Likewise.

        * testsuite/demangle-expected: Revert one part of 2003-06-26 patch
        to restore expected result of EDG test case to original expected
        result.

The problem is inside is_ctor_or_dtor.  is_ctor_or_dtor calls d_mangled_name with top_level=1.  This causes d_encoding to skip the argument characters.  So the new test 'd_peek_char (&di) != '\0'' always triggers, and is_ctor_or_dtor returns 0.



>How-To-Repeat:
Run gdb.cp/classes.exp with -gstabs+ (the default for many versions of gcc is -gdwarf-2, which is why Ian's gdb test run did not find the problem).

To run the test suite with -gstabs+, the cheesy way is to create a directory, drop a wrapper script ("gcc -gstabs+ $*") into the directory, and add that directory to $PATH.  There are other ways but I have this Perl script that does it all for me and I'm too tired to pick it apart.  This could actually use some documentation.


>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]