From: Daniel Jacobowitz <drow@false.org>
To: Pedro Alves <pedro_alves@portugalmail.pt>
Cc: gdb-patches@sourceware.org
Subject: Re: Building solib-target.c when CORE_ADDR != ULONGEST.
Date: Sun, 08 Jul 2007 17:21:00 -0000 [thread overview]
Message-ID: <20070708172134.GA21380@caradoc.them.org> (raw)
In-Reply-To: <4690F562.9060009@portugalmail.pt>
On Sun, Jul 08, 2007 at 03:32:02PM +0100, Pedro Alves wrote:
> About the VEC in question. I noticed that the xml parsing
> xmalloc's the memory for the ULONGEST, but it is safe to
> pass a pointer in a local var, right?
Yes, that's right. The patch is OK.
> I got confused because in vec.h:
>
> "Because of the different behavior of structure objects, scalar
> objects and of pointers, there are three flavors, one for each of
> these variants. Both the structure object and pointer variants
> pass pointers to objects around -- in the former case the pointers
> are stored into the vector and in the latter case the pointers are
> dereferenced and the objects copied into the vector. The scalar
> object variant is suitable for int-like objects, and the vector
> elements are returned by value. "
>
> Something in there confuses me. The former/latter type of
> descriptions adds an indirection that I always find
> distracting.
Far as I can tell, Nathan got his formers and his latters crossed, and
that's why it doesn't make sense.
It would have made more sense for me to use DEF_VEC_I for these than
the DEF_VEC_O I actually used, but to be honest I didn't realize it
was there. The use of DEF_VEC_O makes this rather more confusing
than necessary.
> The 'by value' statement isn't clear to me either:
> "object variant is suitable for int-like objects, and the vector
> elements are returned by value. "
>
> T *VEC_T_index(VEC(T) *v, unsigned ix); // Object
>
> ? What does 'by value' mean then?
The previous word is "scalar". Scalar object -> integer, not
structure object. So the last bit of your correction is wrong.
> 2007-07-08 Pedro Alves <pedro_alves@portugalmail.pt>
>
> * solib-target.c (library_list_start_segment): Cast address to CORE_ADDR.
OK.
--
Daniel Jacobowitz
CodeSourcery
prev parent reply other threads:[~2007-07-08 17:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-08 1:22 Pedro Alves
2007-07-08 1:27 ` Daniel Jacobowitz
2007-07-08 14:46 ` Pedro Alves
2007-07-08 17:21 ` Daniel Jacobowitz [this message]
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=20070708172134.GA21380@caradoc.them.org \
--to=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=pedro_alves@portugalmail.pt \
/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