This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Integer arguments passed to inferior's functions
> Date: Sun, 30 Oct 2011 14:30:01 +0100
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
> Cc: gdb@sourceware.org
>
> 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.
And 1 is an int because it has no l/ll qualifier?
> > 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.