From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1486 invoked by alias); 16 Dec 2010 17:34:37 -0000 Received: (qmail 1347 invoked by uid 22791); 16 Dec 2010 17:34:37 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Dec 2010 17:34:32 +0000 From: "keiths at redhat dot com" To: gdb-prs@sourceware.org Subject: [Bug c++/12328] Can't set breakpoint on method taking const, non-reference/pointer scalar parameter X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: keiths at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Summary Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Thu, 16 Dec 2010 17:37:00 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2010-q4/txt/msg00219.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=12328 Keith Seitz changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Ignore "const" for |Can't set breakpoint on |non-reference/pointer |method taking const, |scalar |non-reference/pointer | |scalar parameter --- Comment #1 from Keith Seitz 2010-12-16 17:34:26 UTC --- This happens because of the constant scalar parameter for "func". Gdb thinks it is really "int" (not "const int"), and when it goes to lookup "myclass::func(int)", it does not find anything. The DIEs pertaining to "myclass" and "func": <1><31>: Abbrev Number: 2 (DW_TAG_class_type) <32> DW_AT_name : (indirect string, offset: 0x71): myclass <36> DW_AT_byte_size : 1 <37> DW_AT_decl_file : 1 <38> DW_AT_decl_line : 2 <39> DW_AT_sibling : <0x51> <2><3d>: Abbrev Number: 3 (DW_TAG_subprogram) <3e> DW_AT_external : 1 <3f> DW_AT_name : (indirect string, offset: 0x0): func <43> DW_AT_decl_file : 1 <44> DW_AT_decl_line : 4 <45> DW_AT_MIPS_linkage_name: (indirect string, offset: 0x59): _ZN7myclass4funcEi <49> DW_AT_declaration : 1 <3><4a>: Abbrev Number: 4 (DW_TAG_formal_parameter) <4b> DW_AT_type : <0x51> <1><51>: Abbrev Number: 5 (DW_TAG_base_type) <52> DW_AT_byte_size : 4 <53> DW_AT_encoding : 5 (signed) <54> DW_AT_name : int <1><58>: Abbrev Number: 6 (DW_TAG_subprogram) <59> DW_AT_specification: <0x3d> <5d> DW_AT_low_pc : 0x400574 <65> DW_AT_high_pc : 0x40057d <6d> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) <6f> DW_AT_sibling : <0x81> <2><73>: Abbrev Number: 7 (DW_TAG_formal_parameter) <74> DW_AT_name : aa <77> DW_AT_decl_file : 1 <78> DW_AT_decl_line : 4 <79> DW_AT_type : <0x81> <7d> DW_AT_location : 2 byte block: 91 6c (DW_OP_fbreg: -20) <1><81>: Abbrev Number: 8 (DW_TAG_const_type) <82> DW_AT_type : <0x51> As you can see, when reading the fieldlists for "myclass", we add an entry for "func" with parameter "int" NOT "const int". Later when the function definition is seen, we correctly get "const int". IMO, this is a compiler bug. I see no reason why the class definition and the function definition should conflict. However, this might be relatively painless to add something to gdb to ignore -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.