From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19639 invoked by alias); 14 Feb 2002 23:32:19 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 19563 invoked from network); 14 Feb 2002 23:32:17 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 14 Feb 2002 23:32:17 -0000 Received: from drow by nevyn.them.org with local (Exim 3.34 #1 (Debian)) id 16bVMP-0007Kn-00 for ; Thu, 14 Feb 2002 18:32:17 -0500 Date: Thu, 14 Feb 2002 15:32:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: [RFA/c++testsuite] New test for constructor breakpoints Message-ID: <20020214183217.A28052@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.23i X-SW-Source: 2002-02/txt/msg00423.txt.bz2 We've got a PR that breakpoints on constructors/destructors do not work in g++ v3 mode. I've identified the problems: - Multiple symbols with the same demangled name. We can work around this for stabs, because we have the physname. We don't have that option for DWARF-2, and we shouldn't need to for stabs. I have a patch for the workaround. We get the [not-in-charge] constructor by default, unfortunately. - stabs does not specify the class name in the debug info for the constructor. Work around it using physnames again. - DWARF-2 we're just getting the wrong functions. I haven't tracked this down yet. This patch passes on g++ v2, fails on g++ v3 without the two patches I'm about to post, and fails on v3 dwarf-2 period. I'll look in to that. OK to commit the tests anyway? -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer 2002-02-14 Daniel Jacobowitz * gdb.c++/ovldbreak.exp: Test breakpoints on the constructors. Index: testsuite/gdb.c++/ovldbreak.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/ovldbreak.exp,v retrieving revision 1.3 diff -u -r1.3 ovldbreak.exp --- ovldbreak.exp 2001/01/28 23:49:43 1.3 +++ ovldbreak.exp 2002/02/14 23:17:55 @@ -231,8 +231,6 @@ \[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\((void|)\\) at.*$srcfile:110" \ "breakpoint info (after cancel)" - - # Delete these breakpoints. send_gdb "delete breakpoints\n" @@ -309,8 +307,36 @@ "breakpoint info (after setting on all)" +# Set breakpoints on the overloaded constructor. +set menu_constructor "\\\[0\\\] cancel\r\n\\\[1\\\] all\r\n\\\[2\\\] foo::foo\\(foo ?&\\) at.*$srcfile:104\r\n\\\[3\\\] foo::foo\\(int, char const ?\\*\\) at.*$srcfile:103\r\n\\\[4\\\] foo::foo\\(int\\) at.*$srcfile:102\r\n> $" +set_bp_overloaded "foo::foo" "$menu_constructor" 2 26 104 +set_bp_overloaded "foo::foo" "$menu_constructor" 3 27 103 +set_bp_overloaded "foo::foo" "$menu_constructor" 4 28 102 + # Run through each breakpoint. + +proc continue_to_bp_constructor {bpnumber argtypes args actuals} { + global gdb_prompt hex decimal srcfile + + send_gdb "continue\n" + gdb_expect { + -re "Continuing.\r\n\r\nBreakpoint ${bpnumber}, (${hex} in )?foo::foo(\\(${argtypes}\\))? \\(this=${hex}(, )?${actuals}\\) at.*${srcfile}:${decimal}\r\n${decimal}\[\t \]+foo::foo *\\(${args}\\).*\r\n.*$gdb_prompt $" { + pass "continue to bp overloaded constructor : ${argtypes}" + } + -re ".*$gdb_prompt $" { + fail "continue to bp overloaded constructor : ${argtypes}" + } + timeout { + fail "continue to bp overloaded constructor : ${argtypes} (timeout)" + } + } +} + +continue_to_bp_constructor 28 "int" "int i" "i=111" +continue_to_bp_constructor 27 "int, char const ?\\*" \ + "int i, const char \\*ccp" "i=222, ccp=$hex \"A\"" +continue_to_bp_constructor 26 "foo ?&" "foo& afoo" "afoo=@$hex" proc continue_to_bp_overloaded {bpnumber argtype actuals} { global gdb_prompt hex decimal srcfile