public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Bruce Korb <bruce.korb@gmail.com>
To: libffi-discuss@sourceware.org
Subject: pass by value and also snprintf()
Date: Mon, 27 Apr 2015 16:59:00 -0000	[thread overview]
Message-ID: <CAKRnqNK1D9Wp3uedW62uVk-5FCfzGgDd0xOA2W9qMQeizV1TSw@mail.gmail.com> (raw)

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

             reply	other threads:[~2015-04-27 16:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-27 16:59 Bruce Korb [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKRnqNK1D9Wp3uedW62uVk-5FCfzGgDd0xOA2W9qMQeizV1TSw@mail.gmail.com \
    --to=bruce.korb@gmail.com \
    --cc=libffi-discuss@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).