This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH]: memory region attributes
"J.T. Conklin" wrote:
>
> >>>>> "Fernando" == Fernando Nasser <fnasser@redhat.com> writes:
> Fernando> Can we just pass zero as the value for the new argument?
>
> It's hard to say no, seeing how I did exactly that to patch up
> sol-thread.c. But I don't think it's the best thing.
>
> Ideally the vector functions are always being called through
> target_xfer_memory() (or the dcache functions, which also look up
> attributes), so in every case an attrib argument will be available.
> It turns out there are some cases where this is not true, but IMHO
> this indicates a problem within GDB's internals.
I don't remember that being a requirement. Was that
documented anywhere?
> In the meantime, we have to handle the case where an attrib argument
> is not available. I'd like the interface to be defined so the target
> vector is always able to dereference the attrib. Otherwise each
> vector function has to "invent" semantics for the case where a null
> attrib pointer is passed. For those target vectors that don't care
> what the attributes are (all of them as of now), it doesn't really
> matter. But in time, this will change.
>
> One possibility is to expose the default attribute. At the present,
> it is wholly contained within memattr.c. But we could expose it for
> now so that it could be passed when no other attribute can be found.
>
> --jtc
>
> --
> J.T. Conklin
> RedBack Networks