Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: dje@google.com (Doug Evans)
To: gdb-patches@sourceware.org
Subject: [patch] info-fun-opt.exp
Date: Tue, 05 Jun 2012 06:35:00 -0000	[thread overview]
Message-ID: <20120605063506.E76E71E1222@ruffy2.mtv.corp.google.com> (raw)

Hi.

Regardless of how we fix the issue outlined here:

http://sourceware.org/ml/gdb-patches/2012-06/msg00109.html

here's a testcase that triggers the issue.
I will check it in once we decide on a fix.

When run with current cvs gdb and a recent gcc it hits the
assert failure in dw2_find_pc_sect_symtab when used with cc-with-index.sh.

(gdb) info fun foo
../../gdb.git/gdb/dwarf2read.c:3049: internal-error: dw2_find_pc_sect_symtab: Assertion `result != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) FAIL: gdb.opt/info-fun-opt.exp: info fun foo (GDB internal error)


2012-06-04  Doug Evans  <dje@google.com>

	* gdb.opt/info-fun-opt.cc: New file.
	* gdb.opt/info-fun-opt.exp: New file.

Index: gdb.opt/info-fun-opt.cc
===================================================================
RCS file: gdb.opt/info-fun-opt.cc
diff -N gdb.opt/info-fun-opt.cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gdb.opt/info-fun-opt.cc	5 Jun 2012 06:27:47 -0000
@@ -0,0 +1,40 @@
+/* Copyright (C) 2012 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 B1
+{
+ public:
+  virtual int foo () { return 1; }
+};
+
+class B2
+{
+ public:
+  virtual int foo () { return 2; }
+};
+
+class M : public B1, B2
+{
+ public:
+  virtual int foo () { return dynamic_cast<B1*>(this)->foo (); }
+};
+
+int
+main ()
+{
+  M *m = new M;
+
+  return m->foo ();
+}
Index: gdb.opt/info-fun-opt.exp
===================================================================
RCS file: gdb.opt/info-fun-opt.exp
diff -N gdb.opt/info-fun-opt.exp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gdb.opt/info-fun-opt.exp	5 Jun 2012 06:27:47 -0000
@@ -0,0 +1,29 @@
+# Copyright 2012 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/>.
+#
+# This file is part of the gdb testsuite.
+
+# Test "info fun" on optimized code.
+# This exercises the use of blockvector.map when tested with cc-with-index.sh.
+
+set basename "info-fun-opt"
+set testfile $basename
+
+if { [prepare_for_testing $testfile.exp $testfile $testfile.cc \
+          {debug c++ optimize=-O2}] } {
+    return -1
+}
+
+gdb_test "info fun foo" "File.*info-fun-opt.*foo.*foo.*foo.*"


             reply	other threads:[~2012-06-05  6:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-05  6:35 Doug Evans [this message]
2012-06-05  7:52 ` Yao Qi
2012-06-06 15:56 ` Jan Kratochvil
2012-07-13 20:27   ` [commit] " Jan Kratochvil

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=20120605063506.E76E71E1222@ruffy2.mtv.corp.google.com \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    /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