This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: [08/11] TI C6X binutils port: opcodes/


+	  if (!z_field)
+	    abort ();

In general, libraries shouldn't call abort().  However, I understand
this one is to catch future programmer errors, not user errors.  I
suggest a comment there that says why it's aborting and what the
programmer needs to do to fix it, since tripping that abort means the
programmer doesn't know what they're doing :-)

Likewise for the other aborts.  IMHO anything that detects programmer
stupidity, should at least educate the programmer too.

+	  status = info->read_memory_func (fp_addr - 32, fp_prev, 32, info);

Do you need to worry about addresses lower than the start of the
section here?  I'm not sure it's even possible for libopcodes to
reliably detect them in this context, but IIRC objdump will complain
if you ask for data outside the section.

+		      operands[op_num] = xmalloc (4);

The longest operand is limited by 24 (largest xmalloc) and the longest
control register name (shorter than 24).  Would it be significantly
faster to avoid all those malloc/free calls, and just create an array
of [][24] ?  That's only 96 bytes total at the moment.  You can
initialize it to {{0}}.


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