[3/4] RFC: introduce gdb_vecs.h
Pedro Alves
palves@redhat.com
Fri Jan 20 16:31:00 GMT 2012
On 01/19/2012 08:26 PM, Tom Tromey wrote:
> I needed a VEC(char_ptr) in another header for patch #4; but this is a
> pain because it is already defined in tracepoint.h, so there can be
> clashes depending.
>
> This patch introduces gdb_vecs.h and moves the DEF_VEC_P there.
> We could add other vector definitions there as well.
>
> This is a bit of a hack, but I think it is basically the best we can do
> given how vec.h works.
>
> Another possibility here is just including vec.h from defs.h and doing
> the DEF_VEC_P there. I thought I'd pull this patch out separately in
> case anybody prefers that approach, or some other; I can implement it.
This approach is fine with me.
One approach I tried once was to forward declare the VECs in the
headers. It needed a tweak to vec.h. The downside is that we'd
need to DEF_VEC_P (char_ptr) in all modules that wanted to use the
VEC, so I gave up on it.
--
Pedro Alves
More information about the Gdb-patches
mailing list