From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25502 invoked by alias); 16 Oct 2008 12:46:37 -0000 Received: (qmail 25442 invoked by uid 22791); 16 Oct 2008 12:46:37 -0000 X-Spam-Check-By: sourceware.org Received: from eu1sys200aog017.obsmtp.com (HELO eu1sys200aog017.obsmtp.com) (207.126.144.131) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 16 Oct 2008 12:45:52 +0000 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob017.postini.com ([207.126.147.11]) with SMTP; Thu, 16 Oct 2008 12:45:48 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 42A5DDA7B for ; Thu, 16 Oct 2008 12:45:48 +0000 (GMT) Received: from mail1.cro.st.com (mail1.cro.st.com [164.129.40.131]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0FF6E4C1F6 for ; Thu, 16 Oct 2008 12:45:48 +0000 (GMT) Received: from crx595.cro.st.com (crx595.cro.st.com [164.129.44.95]) by mail1.cro.st.com (MOS 3.8.7a) with ESMTP id CQD16588 (AUTH "denis pilat"); Thu, 16 Oct 2008 14:46:50 +0200 (CEST) Message-ID: <48F7377B.3070603@st.com> Date: Thu, 16 Oct 2008 12:46:00 -0000 From: Denis PILAT User-Agent: Thunderbird 2.0.0.17 (X11/20080914) MIME-Version: 1.0 To: gdb-patches Subject: [Fwd: multiple location in C++ constructors] Content-Type: multipart/mixed; boundary="------------040704030103040100010409" 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: 2008-10/txt/msg00405.txt.bz2 This is a multi-part message in MIME format. --------------040704030103040100010409 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1 --------------040704030103040100010409 Content-Type: message/rfc822; name="multiple location in C++ constructors.eml" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="multiple location in C++ constructors.eml" Content-length: 4139 Return-Path: Received: from epsilon.dmz-us.st.com (ns3.st.com [167.4.80.116]) by mail1.cro.st.com (MOS 3.8.7a) with ESMTP id CQC58324; Tue, 14 Oct 2008 17:14:58 +0200 (CEST) Received: from alpha1.dmz-us.st.com (alpha1.dmz-us.st.com [167.4.1.45]) by epsilon.dmz-us.st.com (STMicroelectronics) with ESMTP id F3EC24A445 for ; Tue, 14 Oct 2008 15:13:55 +0000 (GMT) Received: from psmtp.com (eu1sys200amx004.postini.com [207.126.144.44]) by alpha1.dmz-us.st.com (STMicroelectronics) with SMTP id 59F546B3A3 for ; Tue, 14 Oct 2008 15:13:53 +0000 (GMT) Received: from source ([209.132.176.174]) by eu1sys200amx004.postini.com ([207.126.147.10]) with SMTP; Tue, 14 Oct 2008 18:13:52 IDT Received: (qmail 18301 invoked by alias); 14 Oct 2008 15:13:47 -0000 Received: (qmail 18289 invoked by uid 22791); 14 Oct 2008 15:13:46 -0000 X-Spam-Check-By: sourceware.org Received: from eu1sys200aog017.obsmtp.com (HELO eu1sys200aog017.obsmtp.com) (207.126.144.131) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 14 Oct 2008 15:13:01 +0000 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob017.postini.com ([207.126.147.11]) with SMTP; Tue, 14 Oct 2008 15:12:57 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id ADAE7DB17 for ; Tue, 14 Oct 2008 15:12:56 +0000 (GMT) Received: from mail1.cro.st.com (mail1.cro.st.com [164.129.40.131]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 83F4F4C45C for ; Tue, 14 Oct 2008 15:12:56 +0000 (GMT) Received: from crx595.cro.st.com (crx595.cro.st.com [164.129.44.95]) by mail1.cro.st.com (MOS 3.8.7a) with ESMTP id CQC58291 (AUTH "denis pilat"); Tue, 14 Oct 2008 17:13:57 +0200 (CEST) Message-ID: <48F4B6F7.2010109@st.com> Date: Tue, 14 Oct 2008 17:12:55 +0200 From: Denis PILAT User-Agent: Thunderbird 2.0.0.17 (X11/20080914) MIME-Version: 1.0 To: gdb@sourceware.org Subject: multiple location in C++ constructors Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Delivered-To: mailing list gdb@sourceware.org X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:99.90000/99.90000 CV:99.9999 ) X-pstn-settings: 2 (0.5000:0.5000) s cv gt3 gt2 gt1 X-pstn-addresses: from [189/12] Content-length: 1247 We (at ST) have a compiler that generates DW_AT_MIPS_linkage_name attributes for constructors. Unfortunately, that prevents breakpoint in constructor to have multiple locations since the gdb heuristics eliminates one location in the expand_line_sal_maybe() function of breakpoint.c: see bellow, we go thru the remove_sal () line. (from breakpoint.c) struct symtabs_and_lines expand_line_sal_maybe (struct symtab_and_line sal) ... if (find_pc_partial_function (pc, &this_function, &func_addr, &func_end)) { if (this_function && strcmp (this_function, original_function) != 0) { remove_sal (&expanded, i); --i; } else if (func_addr == pc) ... If present into dwarf2 debug information, the find_pc_partial_function() returns the DW_AT_MIPS_linkage_name in this_function, which is alway different from the original_function. Therefore there is always only one location for constructor breakpoints since the DW_AT_MIPS_linkage_name is filled with the mangled function name. My question is: Is the GDB heuristic to find multiple location for breakpoint wrong ? Or is the DW_AT_MIPS_linkage_name attribute for constructors useless in debug informations ? Thanks for your feedback Denis --------------040704030103040100010409--