This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v4 02/10] Make gdbserver reg_defs a vector of objects


On 2018-03-23 12:52, Alan Hayward wrote:
The offset value is always 0 initially, so you can remove it and initialize it to 0.


Reason I added offset here was that in "Commonise tdesc_reg” this code
will get merged into init_target_desc().
At that point I’ll be creating a reg and setting and offset at the same time.
This was just so that I didn’t need to touch regdef.h again.

I can still remove offset from this patch if you want - given that I’m
not using it yet?

This it not terribly important, but I think it's better to only add it once you really need it. The proposed patches could change, and the parameter could end up unused (not saying that's what will happen here, it's just an example).

Simon


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]