From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 15:13:00 -0000 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-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-10/txt/msg00060.txt.bz2 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