From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30272 invoked by alias); 5 Jun 2008 20:38:19 -0000 Received: (qmail 30217 invoked by uid 22791); 5 Jun 2008 20:38:18 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 05 Jun 2008 20:37:51 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 32E9D983F8; Thu, 5 Jun 2008 20:37:50 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id DFB149809F; Thu, 5 Jun 2008 20:37:49 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1K4MDU-00014S-Pf; Thu, 05 Jun 2008 16:37:48 -0400 Date: Thu, 05 Jun 2008 20:38:00 -0000 From: Daniel Jacobowitz To: Paul Pluzhnikov Cc: gdb-patches@sourceware.org, Doug Evans Subject: Re: [RFA] Patch for incorrect handling of references to pointers [pr1147] Message-ID: <20080605203748.GA3818@caradoc.them.org> Mail-Followup-To: Paul Pluzhnikov , gdb-patches@sourceware.org, Doug Evans References: <8ac60eac0805081418md64f7bcha08664e9554e5750@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8ac60eac0805081418md64f7bcha08664e9554e5750@mail.gmail.com> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-06/txt/msg00072.txt.bz2 On Thu, May 08, 2008 at 02:18:53PM -0700, Paul Pluzhnikov wrote: > Greetings, > > Attached patch fixes incorrect handling of "this" when reference > to pointer is used: > http://sourceware.org/cgi-bin/gnatsweb.pl?cmd=view&database=gdb&pr=1147 > and adds a test case for it. Since there's a PR, please mention it in the changelog and commit message; it'll show up in gnats automatically. Assuming we eventually switch to bugzilla, the same thing will work there. For instance: 2008-05-08 Paul Pluzhnikov PR gdb/1147 * valopts.c (find_overload_match): Handle references to pointers. > --- gdb/testsuite/gdb.cp/call-c.exp.orig 2008-05-08 14:01:57.000000000 -0700 > +++ gdb/testsuite/gdb.cp/call-c.exp 2008-05-08 13:54:14.497857000 -0700 > @@ -44,3 +44,6 @@ gdb_load ${binfile} > runto_main > > gdb_test "print foo(1)" "\\\$$decimal = 1" > +send_gdb "next\nnext\nnext\n" > +gdb_expect -re "$gdb_prompt $" > +gdb_test "print rf->func()" "\\\$$decimal = 1" This is an unsafe use of send_gdb, because the gdb_expect might match only the first of three expected prompts depending when there is a pause in the output. In general, relying on multiple nexts makes the test case hard to modify; can you set a breakpoint and use gdb_get_line_number to find the line to break on? > --- gdb/valops.c.orig 2008-05-08 14:01:57.000000000 -0700 > +++ gdb/valops.c 2008-05-08 13:57:14.320875000 -0700 > @@ -1919,7 +1919,8 @@ find_overload_match (struct type **arg_t > if (objp) > { > if (TYPE_CODE (value_type (temp)) != TYPE_CODE_PTR > - && TYPE_CODE (value_type (*objp)) == TYPE_CODE_PTR) > + && (TYPE_CODE (value_type (*objp)) == TYPE_CODE_PTR > + || (TYPE_CODE (value_type (*objp)) == TYPE_CODE_REF))) One more set of parens on the last line than you need. Sorry about the delay. -- Daniel Jacobowitz CodeSourcery