This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: "too few arguments in function call"


André Pönitz <apoenitz@trolltech.com> writes:

> However, if I do something like   gdb ./myapp-with-all-plugins  I get
>
>   (gdb) p "xxx"
>   too few arguments in function call

When gdb processes a string in an expression it allocates space in the
inferior by calling malloc and copying the string contents into this
space.  Apparently gdb gets confused when it looks up the address of the
malloc function.

> When this message is issued in infcall.c, nargs is always 1, and
> TYPE_NFIELDS (ftype) is 2, independently of the arity of the called
> function, so it really seems to involve the 'string literal conversion'
> (or parsing, or whatever gdb does at that point).

What does `info function malloc' show?

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]