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 7/11] Add BFIN_MAX_REGISTER_SIZE


Alan Hayward <Alan.Hayward@arm.com> writes:

> Is it not clearer code to add and use a macro rather than a magic number ?
>

Macro is better, but "buf[4]" is not that magic, because it is only used
within bfin_pseudo_register_read, or we can define ASTAT_REGISTER_SIZE.

> It’s also not obvious anywhere that the astat register is 32bits. I had to go
> digging inside regformats/reg-bfin.dat before I found it out.

It is easier to figure out the size of a specific register than the max
size of a set of registers.

>
> Given that BFIN_MAX_REGISTER_SIZE is also 4, it compiles to the same
> size anyway.

"gdb_byte buf[BFIN_MAX_REGISTER_SIZE]" is fine to me.  Could you define
BFIN_MAX_REGISTER_SIZE in bfin-tdep.c instead of .h?  It is not used
elsewhere.

-- 
Yao (齐尧)


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