From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13840 invoked by alias); 16 May 2012 01:55:23 -0000 Received: (qmail 13805 invoked by uid 22791); 16 May 2012 01:55:22 -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; Wed, 16 May 2012 01:55:09 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1SUTSF-0004ku-Tv from Yao_Qi@mentor.com ; Tue, 15 May 2012 18:55:07 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 15 May 2012 18:54:52 -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; Tue, 15 May 2012 18:54:13 -0700 Message-ID: <4FB308F4.50602@codesourcery.com> Date: Wed, 16 May 2012 01:55: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: Mark Kettenis 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> <4FACEB4B.1060603@codesourcery.com> <20120514171453.GL10253@adacore.com> <4FB1FCD2.5070302@codesourcery.com> <201205151802.q4FI2O2Y013475@glazunov.sibelius.xs4all.nl> In-Reply-To: <201205151802.q4FI2O2Y013475@glazunov.sibelius.xs4all.nl> 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/msg00592.txt.bz2 On 05/16/2012 02:02 AM, Mark Kettenis wrote: >> > 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? In an inferior call, there are two steps related to ABI, 1) passing parameters, 2) fetching return value. The "hidden parameter" is relevant to both steps. Your description above is correct, and it is about step 2. My patches are trying to fix the problems in step 1. So far, GDB passes hidden parameter for some language, but on some targets, the hidden parameter is not passed by parameter register, it is passed by other register specified by its ABI. GDB is wrong if it still pass hidden parameter to parameter register. -- Yao (齐尧)