This is the mail archive of the gdb-patches@sources.redhat.com 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: [RFA] mips-tdep.c: Add dwarf/dwarf2 regnum mapping functions


Okay?


Yes, just make it a little bit more robust. The i386 does this:


   /* This will hopefully provoke a warning.  */
   return NUM_REGS + NUM_PSEUDO_REGS;

when it doesn't know what to do with a register.


Rather than hoping that returning an out of range register number will
provoke a warning (at some indeterminate point in the future),
wouldn't it be better to call complaint() directly?  Or, alternatively,
define a return value (e.g. -1) which callers of *_REG_TO_REGNUM would
then check so that an appropriate complaint could be registered?

True. In the mean time, these new methods might as well be consistent with the other existing reg_to_regnum methods (from memory, it does eventually provoke a warning).


Andrew



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