From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5575 invoked by alias); 5 Jun 2012 06:35:23 -0000 Received: (qmail 5566 invoked by uid 22791); 5 Jun 2012 06:35:21 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-gh0-f201.google.com (HELO mail-gh0-f201.google.com) (209.85.160.201) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Jun 2012 06:35:08 +0000 Received: by ghbg15 with SMTP id g15so572374ghb.0 for ; Mon, 04 Jun 2012 23:35:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=to:subject:message-id:date:from:x-gm-message-state; bh=HA4239kBLjv1cxzFdVqTp6lo08+oN5BrRoVel7YdXhs=; b=m0IHVtUOJKCz+TUQycErZadcK+8b4Dt3WJixPj5NYX4BedfjO9itIKi+SGcuL6d1BN leJNcMMJkzxFDNlQm3CKiyg5jsrIcG1OZnYtzNOrA6yQka+md9fQsHhXrj87j9Izmz4+ 8K8hLWoVAcOweqLPL4vHty/8q8chy5SO+w5miu5j67oeFJKD88svzcWL/g/nzqiyYL4u rb7I8i9u+Bpz7tfRz7KCIMHbi3K8nsdYk7GM0y0ZY5wHOmy988zwWOMYZlrgP3GnRuOK /xGvmdtvFZNuFlwowNPXuR57y5efr4Xqna98vFKMrDHr8d1RNc823bNvcX6h3/iaA3zA 8Y3Q== Received: by 10.101.16.19 with SMTP id t19mr6844321ani.4.1338878107489; Mon, 04 Jun 2012 23:35:07 -0700 (PDT) Received: by 10.101.16.19 with SMTP id t19mr6844315ani.4.1338878107412; Mon, 04 Jun 2012 23:35:07 -0700 (PDT) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id b8si508959yhn.6.2012.06.04.23.35.07 (version=TLSv1/SSLv3 cipher=AES128-SHA); Mon, 04 Jun 2012 23:35:07 -0700 (PDT) Received: from ruffy2.mtv.corp.google.com (ruffy2.mtv.corp.google.com [172.18.110.129]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 472F210004D for ; Mon, 4 Jun 2012 23:35:07 -0700 (PDT) Received: by ruffy2.mtv.corp.google.com (Postfix, from userid 67641) id E76E71E1222; Mon, 4 Jun 2012 23:35:06 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [patch] info-fun-opt.exp Message-Id: <20120605063506.E76E71E1222@ruffy2.mtv.corp.google.com> Date: Tue, 05 Jun 2012 06:35:00 -0000 From: dje@google.com (Doug Evans) X-Gm-Message-State: ALoCoQmTxuI4eVT1Ts31eUbhCeCa4yrbh5GWYHD5MR0rTx32nxgyuJnqWm3ErvtktkMawJ1Y8FFK1rL9zjriKAQHUg1cPr1nnxOwlun+sLdd3UdMWoKUMbEbiYuyar1wPjCzocl9oPDgxwLFoeWbpgE/7SEwrRcDvgQ0ZarxmKlqbH7Gm6uVTuU= 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: 2012-06/txt/msg00111.txt.bz2 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 * 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 . */ + +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(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 . +# +# 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.*"