Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: [commit] Re: [patch] physname regression: Non-matching type false breakpoint
Date: Fri, 01 Jul 2011 20:29:00 -0000	[thread overview]
Message-ID: <20110701202859.GC22980@host1.jankratochvil.net> (raw)
In-Reply-To: <201106071758.28138.pedro@codesourcery.com>

On Tue, 07 Jun 2011 18:58:27 +0200, Pedro Alves wrote:
> On Monday 06 June 2011 22:19:43, Jan Kratochvil wrote:
> > -  if (i1 == 1)
> > +  /* If we were given a specific overload instance in COPY defer the field
> > +     acceptance till the strcmp_iw verification below even if we found just
> > +     a single field with that name.  */
> 
> I suggest a comma after "COPY", and another after "below".

Done.

Checked in.


Thanks,
Jan


http://sourceware.org/ml/gdb-cvs/2011-07/msg00031.html

--- src/gdb/ChangeLog	2011/07/01 20:18:59	1.13153
+++ src/gdb/ChangeLog	2011/07/01 20:27:58	1.13154
@@ -1,5 +1,10 @@
 2011-07-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
+	* linespec.c (find_method): Accept the function type automatically only
+	if it was specified with parameter types.
+
+2011-07-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
 	Stop on first linespec terminator instead of eating what we can.
 	* linespec.c (is_linespec_boundary): New function.
 	(name_end): Remove function.
--- src/gdb/linespec.c	2011/07/01 20:19:03	1.124
+++ src/gdb/linespec.c	2011/07/01 20:27:58	1.125
@@ -1697,7 +1697,10 @@
   i1 = find_methods (t, copy, SYMBOL_LANGUAGE (sym_class), sym_arr,
 		     file_symtab);
 
-  if (i1 == 1)
+  /* If we were given a specific overload instance in COPY, defer the field
+     acceptance till the strcmp_iw verification below, even if we found just
+     a single field with that name.  */
+  if (i1 == 1 && strchr (copy, '(') == NULL)
     {
       /* There is exactly one field with that name.  */
       sym = sym_arr[0];
--- src/gdb/testsuite/ChangeLog	2011/07/01 20:19:03	1.2776
+++ src/gdb/testsuite/ChangeLog	2011/07/01 20:27:59	1.2777
@@ -1,5 +1,10 @@
 2011-07-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
+	* gdb.cp/paren-type.cc: New files.
+	* gdb.cp/paren-type.exp: New files.
+
+2011-07-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
 	Stop on first linespec terminator instead of eating what we can.
 	* gdb.cp/minsym-fallback-main.cc (main): Call also C::operator ().
 	* gdb.cp/minsym-fallback.cc (C::operator ()): Define.
--- src/gdb/testsuite/gdb.cp/paren-type.cc
+++ src/gdb/testsuite/gdb.cp/paren-type.cc	2011-07-01 20:28:47.786329000 +0000
@@ -0,0 +1,33 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+   Copyright 2011 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+class C
+{
+public:
+  static void f (short x);
+};
+
+void
+C::f (short x)
+{
+}
+
+int
+main ()
+{
+  C::f(1);
+}
--- src/gdb/testsuite/gdb.cp/paren-type.exp
+++ src/gdb/testsuite/gdb.cp/paren-type.exp	2011-07-01 20:28:48.069315000 +0000
@@ -0,0 +1,26 @@
+# Copyright (C) 2011 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+set testfile paren-type
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${testfile}.cc {c++ debug}] } {
+    return -1
+}
+
+gdb_test_no_output "set breakpoint pending off"
+
+gdb_test "break C::f(long)" {Function "C::f\(long\)" not defined\.}
+
+# Sanity check the breakpoints work for the correct type.
+gdb_test "break C::f(short)" "Breakpoint 1 at \[^\r\n\]*"


      reply	other threads:[~2011-07-01 20:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-05 15:34 Jan Kratochvil
2011-06-05 15:57 ` Mark Kettenis
2011-06-05 16:19   ` comments formatting [Re: [patch] physname regression: Non-matching type false breakpoint] Jan Kratochvil
2011-06-05 16:23     ` Andreas Schwab
2011-06-05 16:35       ` Jan Kratochvil
2011-06-05 16:50         ` Alfred M. Szmidt
2011-06-05 16:57           ` Jan Kratochvil
2011-06-05 17:15             ` Alfred M. Szmidt
2011-06-05 17:24               ` Jan Kratochvil
2011-06-05 22:25                 ` Alfred M. Szmidt
2011-06-05 17:49         ` Mark Kettenis
2011-06-06  9:22 ` [patch] physname regression: Non-matching type false breakpoint Pedro Alves
2011-06-06 21:20   ` Jan Kratochvil
2011-06-07 16:58     ` Pedro Alves
2011-07-01 20:29       ` Jan Kratochvil [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110701202859.GC22980@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox