From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27034 invoked by alias); 30 Oct 2011 13:30:27 -0000 Received: (qmail 27025 invoked by uid 22791); 30 Oct 2011 13:30:26 -0000 X-SWARE-Spam-Status: No, hits=-7.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 30 Oct 2011 13:30:08 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9UDU5VO005154 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 30 Oct 2011 09:30:05 -0400 Received: from host1.jankratochvil.net (ovpn-116-23.ams2.redhat.com [10.36.116.23]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p9UDU3EY018756 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 30 Oct 2011 09:30:04 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p9UDU2NP010911; Sun, 30 Oct 2011 14:30:02 +0100 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p9UDU16Y010894; Sun, 30 Oct 2011 14:30:01 +0100 Date: Sun, 30 Oct 2011 13:51:00 -0000 From: Jan Kratochvil To: Eli Zaretskii Cc: gdb@sourceware.org Subject: Re: Integer arguments passed to inferior's functions Message-ID: <20111030133001.GA10717@host1.jankratochvil.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2011-10/txt/msg00228.txt.bz2 On Sun, 30 Oct 2011 07:38:44 +0100, Eli Zaretskii wrote: > If I type > > (gdb) call foo(1) > > what will be the type of the argument GDB will pass to `foo'? Will > GDB look up the function signature or will it use some default?. Yes, it looks up the function signature, see the value_arg_coerce call in call_function_by_hand. It uses the passed parameter (typeof (1) -> int here) if the parameter is after the known count of parameter types. > If the former, what happens when the signature is unknown or unavailable? The known parameters count is 0 in such case. > If the latter, how is that default computed? value_type of that value (1 here, therefore int). > does it depend on the inferior's architecture, for instance? After all these types are determined you are right the types are further promoted depending on the arch, by gdbarch_push_dummy_call. Thanks, Jan