This is the mail archive of the gdb-patches@sourceware.cygnus.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]

Re: sh-stub.c SH4 & SCIF support



   From: Toshiyasu Morita <tm@netcom.com>
   Date: Wed, 19 May 1999 15:39:23 -0700 (PDT)

   I've hacked some SH4 and SCIF support into the sh-stub.c file.

Thanks for the submission!

Before patching in, there are a couple issues I'd like to resolve first.

   + #ifdef __SH4__

   + #ifdef __sh4__

Is there some reason why these are different symbols?

   + #if defined(__sh4__) || defined(__SH4_SINGLE_ONLY__)

Isn't the __SH4_SINGLE_ONLY__ test redundant?

   + static int computeSignal(int exception_num)
   + 
   + {
   + 	switch (exception_num) {
   + 
   + 		case 0x180:	/* General illegal instruction exception */
   + 		case 0x0e0:	/* Instruction address error */
   + 		case 0x820;	/* Slot illegal instruction exception */
   + 
   + 			return SIGILL;	/* Illegal instruction */

Your new code needs to conform to the GNU coding standards.  (I know a
lot of the stub doesn't, but we gotta start somewhere.)  For instance,
the above code should look like this:

static int
computeSignal (int exception_num)
{
  switch (exception_num)
   {
      case 0x180:	/* General illegal instruction exception */
      case 0x0e0:	/* Instruction address error */
      case 0x820;	/* Slot illegal instruction exception */
	return SIGILL;	/* Illegal instruction */
[...]

If you make all these changes, I can put them in.  BTW, your comments
are pretty good, I learned some interesting details of using the SH4
from them.

								Stan

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