From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28367 invoked by alias); 11 May 2012 10:35:12 -0000 Received: (qmail 28236 invoked by uid 22791); 11 May 2012 10:35:11 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 11 May 2012 10:34:58 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1SSnBZ-00010W-8y from Yao_Qi@mentor.com ; Fri, 11 May 2012 03:34:57 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 11 May 2012 03:34:57 -0700 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.1.289.1; Fri, 11 May 2012 03:34:19 -0700 Message-ID: <4FACEB4B.1060603@codesourcery.com> Date: Fri, 11 May 2012 10:35:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: Joel Brobecker CC: , Subject: Re: [PATCH 1/4] New gdb arch hook: return_with_first_hidden_param_p References: <1334755073-26528-1-git-send-email-yao@codesourcery.com> <20120503011435.GA3294@adacore.com> <4FA22D7B.1040707@codesourcery.com> <20120504175830.GQ15555@adacore.com> <4FA743EC.1080903@codesourcery.com> <20120507201345.GX15555@adacore.com> <4FAA2D25.4060700@codesourcery.com> <20120510212054.GA5886@adacore.com> In-Reply-To: <20120510212054.GA5886@adacore.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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-05/txt/msg00401.txt.bz2 On 05/11/2012 05:20 AM, Joel Brobecker wrote: >> > Agreed. I stared at these debug info for a while, but unable to have >> > a clue on heuristics. My feeling is that these debug info doesn't give >> > us more than what source code can give, but the heuristics we are looking >> > for are about the difference on different targets, given the same source. >> > That is to say, on different targets, although the number of parameters >> > is different, the debug info is almost the same and hard to get heuristics, > Can we use the fact that functions that have their first parameter > be a nameless, artificial, paramter whose type is a pointer to > the return type? Or would this heuristics trigger in other situations? > Yeah, I thought of that heuristics, but it still can't differentiate passing 3 or 4 parameters. So far, the discussion in dwarf-discuss@ gives me a feeling that "DW_AT_artificial_type"/"DW_ART_return_block" looks quite promising for this problem, but it requires changes in gcc/binutils, and I haven't investigate the history of it to see why it is ada-specific, instead of a general attribute. > If that doesn't work, then I am running out of ideas, and then we'll > have to start looking giving GDB insider knowledge. But I really don't > like that idea. Well, we have to compromise :) Could you please re-consider this patch series, as it is a trade-off, and not perfect? If this patch series is still not acceptable, we may create a variant (or sub-class) of gnu-v3-abi, say "gnu-v3-pass-implicit-param" or something similar, for targets affected by this problem, and `set_cp_abi_as_auto_default ("gnu-v3-pass-implicit-param")' in each target backend. (This is my rough thought, and need some experiments to see it works or not). Even, if GCC in the future starts to pass implicit parameter for these ports, we can switch to gnu-v3, and users just have to type `set cp-abi gnu-v3' without rebuilding their GDB. -- Yao (齐尧)