public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* pass by value and also snprintf()
@ 2015-04-27 16:59 Bruce Korb
  2015-04-27 17:09 ` Richard Henderson
  0 siblings, 1 reply; 7+ messages in thread
From: Bruce Korb @ 2015-04-27 16:59 UTC (permalink / raw)
  To: libffi-discuss

I read this paragraph and have a question:

  avalues is a vector of void * pointers that point to the memory
locations holding the argument values for a call.
  If cif declares that the function has no arguments (i.e., nargs was
0), then avalues is ignored. Note that
  argument values may be modified by the callee (for instance, structs
passed by value); the burden of
  copying pass-by-value arguments is placed on the caller.

If libffi moves the values into places where the callee can find them,
it would be interesting
to know how the callee can modify the original value.  That value
cannot be at the place pointed to
by the "avalues" array of pointers.

- - - - -

Anyway, I believe in my last missive, I had all the arguments for
snprintf() set up correctly,
yet snprintf faulted anyway.  Since GDB showed everything as I would
expect and since
I cannot make much sense of what the ffi_call_unix64 is doing, I hope
there is an
obvious answer to what I am missing:

https://sourceware.org/ml/libffi-discuss/2015/msg00063.html

Thank you in advance!  Regards, Bruce

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-04-27 18:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-27 16:59 pass by value and also snprintf() Bruce Korb
2015-04-27 17:09 ` Richard Henderson
2015-04-27 17:37   ` Bruce Korb
2015-04-27 17:45     ` Bruce Korb
2015-04-27 17:48       ` Bruce Korb
2015-04-27 18:02     ` Richard Henderson
2015-04-27 18:54       ` Bruce Korb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).