From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23581 invoked by alias); 15 May 2012 18:03:11 -0000 Received: (qmail 23548 invoked by uid 22791); 15 May 2012 18:03:09 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 May 2012 18:02:54 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id q4FI2Qo6017557; Tue, 15 May 2012 20:02:26 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id q4FI2O2Y013475; Tue, 15 May 2012 20:02:24 +0200 (CEST) Date: Tue, 15 May 2012 18:03:00 -0000 Message-Id: <201205151802.q4FI2O2Y013475@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: yao@codesourcery.com CC: brobecker@adacore.com, gdb-patches@sourceware.org, cltang@codesourcery.com In-reply-to: <4FB1FCD2.5070302@codesourcery.com> (message from Yao Qi on Tue, 15 May 2012 14:50:58 +0800) 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> <4FACEB4B.1060603@codesourcery.com> <20120514171453.GL10253@adacore.com> <4FB1FCD2.5070302@codesourcery.com> 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/msg00586.txt.bz2 > Date: Tue, 15 May 2012 14:50:58 +0800 > From: Yao Qi > > On 05/15/2012 01:14 AM, Joel Brobecker wrote: > >>> > > 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, you are saying that we have functions who have an extra hidden > > parameter used for something other than the function's return value? > > > > No, the extra hidden parameter's type is the reference of the function's > return type. My point is if we only examine debug info, we don't know > whether hidden parameter is passed, because the debug info is the same > regardless of hidden parameter is passed or not. I'm still very confused. This "hidden parameter" thing sounds exactly like "struct_return". So are you saying that on some architectures gdbarch_return_value() return RETUN_VALUE_REGISTER_CONVENTION when if fact for C++ (and not for plain C) it should return RETURN_VALUE_STRUCT_CONVENTION?