From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32101 invoked by alias); 14 Mar 2013 11:16:44 -0000 Received: (qmail 32010 invoked by uid 22791); 14 Mar 2013 11:16:43 -0000 X-SWARE-Spam-Status: No, hits=-7.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Mar 2013 11:15:59 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2EBFwN3016430 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 14 Mar 2013 07:15:59 -0400 Received: from psique (ovpn-113-44.phx2.redhat.com [10.3.113.44]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2EBFttu014279 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 14 Mar 2013 07:15:57 -0400 From: Sergio Durigan Junior To: Tom Tromey Cc: GDB Patches , Keith Seitz Subject: Re: [PATCH] Fix for PR c++/15203 and PR c++/15210 References: <87wqtb9ht6.fsf@fleche.redhat.com> X-URL: http://www.redhat.com Date: Thu, 14 Mar 2013 11:16:00 -0000 In-Reply-To: <87wqtb9ht6.fsf@fleche.redhat.com> (Tom Tromey's message of "Wed, 13 Mar 2013 14:16:21 -0600") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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: 2013-03/txt/msg00620.txt.bz2 On Wednesday, March 13 2013, Tom Tromey wrote: > Sergio> + else if (sym->flags & (BSF_GLOBAL | BSF_LOCAL | BSF_WEAK | BSF_GNU_UNIQUE)) > > I think this line is too long. > > Sergio> +# Regression test for PR c++/15203 and PR c++/15210 > Sergio> +gdb_test "print 'gnu_obj_1::method()::sintvar'" "\\$\[0-9\]+ = 4" \ > Sergio> + "simple object, static const int, accessing via 'class::method::variable" > > I think the second line should only be indented 4 spaces. > > Ok with those changes. Thanks, the patch below is what I have actually committed. http://sourceware.org/ml/gdb-cvs/2013-03/msg00130.html -- Sergio Index: gdb/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.15271 diff -u -r1.15271 ChangeLog --- gdb/ChangeLog 14 Mar 2013 09:08:55 -0000 1.15271 +++ gdb/ChangeLog 14 Mar 2013 11:09:26 -0000 @@ -1,3 +1,13 @@ +2013-03-14 Keith Seitz + Alan Matsuoka + + PR c++/15203 + PR c++/15210 + * cp-namespace.c (cp_lookup_nested_symbol): Handle TYPE_CODE_FUNC and + TYPE_CODE_METHOD. + * elfread.c (elf_symtab_read): Handle BSF_GNU_UNIQUE for certain + symbols. + 2013-03-14 Yao Qi * tracepoint.c (tfile_write_status): Write 'stop_desc' of trace Index: gdb/cp-namespace.c =================================================================== RCS file: /cvs/src/src/gdb/cp-namespace.c,v retrieving revision 1.65 diff -u -r1.65 cp-namespace.c --- gdb/cp-namespace.c 31 Jan 2013 18:37:37 -0000 1.65 +++ gdb/cp-namespace.c 14 Mar 2013 11:09:26 -0000 @@ -812,6 +812,11 @@ base classes. */ return find_symbol_in_baseclass (parent_type, nested_name, block); } + + case TYPE_CODE_FUNC: + case TYPE_CODE_METHOD: + return NULL; + default: internal_error (__FILE__, __LINE__, _("cp_lookup_nested_symbol called " Index: gdb/elfread.c =================================================================== RCS file: /cvs/src/src/gdb/elfread.c,v retrieving revision 1.148 diff -u -r1.148 elfread.c --- gdb/elfread.c 6 Mar 2013 21:20:02 -0000 1.148 +++ gdb/elfread.c 14 Mar 2013 11:09:27 -0000 @@ -357,7 +357,8 @@ } else if (sym->flags & BSF_SECTION_SYM) continue; - else if (sym->flags & (BSF_GLOBAL | BSF_LOCAL | BSF_WEAK)) + else if (sym->flags & (BSF_GLOBAL | BSF_LOCAL | BSF_WEAK + | BSF_GNU_UNIQUE)) { struct minimal_symbol *msym; @@ -413,7 +414,7 @@ } else if (sym->section->flags & SEC_CODE) { - if (sym->flags & (BSF_GLOBAL | BSF_WEAK)) + if (sym->flags & (BSF_GLOBAL | BSF_WEAK | BSF_GNU_UNIQUE)) { if (sym->flags & BSF_GNU_INDIRECT_FUNCTION) ms_type = mst_text_gnu_ifunc; @@ -443,7 +444,7 @@ } else if (sym->section->flags & SEC_ALLOC) { - if (sym->flags & (BSF_GLOBAL | BSF_WEAK)) + if (sym->flags & (BSF_GLOBAL | BSF_WEAK | BSF_GNU_UNIQUE)) { if (sym->section->flags & SEC_LOAD) { Index: gdb/testsuite/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/testsuite/ChangeLog,v retrieving revision 1.3583 diff -u -r1.3583 ChangeLog --- gdb/testsuite/ChangeLog 14 Mar 2013 09:12:20 -0000 1.3583 +++ gdb/testsuite/ChangeLog 14 Mar 2013 11:09:29 -0000 @@ -1,3 +1,11 @@ +2013-03-14 Sergio Durigan Junior + + PR c++/15203 + PR c++/15210 + * gdb.cp/m-static.cc (keepalive_int): New function. + (gnu_obj_1::method): New variable `sintvar', call `keepalive_int'. + * gdb.cp/m-static.exp: New test for `sintvar'. + 2013-03-14 Yao Qi * gdb.trace/tstatus.exp (run_trace_experiment): Save the output Index: gdb/testsuite/gdb.cp/m-static.cc =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/m-static.cc,v retrieving revision 1.6 diff -u -r1.6 m-static.cc --- gdb/testsuite/gdb.cp/m-static.cc 12 Feb 2013 20:27:36 -0000 1.6 +++ gdb/testsuite/gdb.cp/m-static.cc 14 Mar 2013 11:09:29 -0000 @@ -3,6 +3,7 @@ enum region { oriental, egyptian, greek, etruscan, roman }; void keepalive(bool *var) { } +void keepalive_int (int *var) { } // Test one. class gnu_obj_1 @@ -21,8 +22,11 @@ long method () { + static int sintvar = 4; static bool svar = true; + keepalive (&svar); + keepalive_int (&sintvar); return key2; } }; Index: gdb/testsuite/gdb.cp/m-static.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/m-static.exp,v retrieving revision 1.21 diff -u -r1.21 m-static.exp --- gdb/testsuite/gdb.cp/m-static.exp 12 Feb 2013 20:27:36 -0000 1.21 +++ gdb/testsuite/gdb.cp/m-static.exp 14 Mar 2013 11:09:29 -0000 @@ -52,6 +52,11 @@ # One. +# simple object, static const int, accessing via 'class::method::variable' +# Regression test for PR c++/15203 and PR c++/15210 +gdb_test "print 'gnu_obj_1::method()::sintvar'" "\\$\[0-9\]+ = 4" \ + "simple object, static const int, accessing via 'class::method::variable" + # simple object, static const bool gdb_test "print test1.test" "\\$\[0-9\]* = true" "simple object, static const bool"