Tuesday, December 18, 2012

GDB 7.1 doesn't compile!

In order to get the armsupp.c file to compile in gdb-7.1, I had to make the return actually return something. Just a note for those of you who use arm-elf-gdb on macports, it will not compile out of the box. I've included the function in question, the change needs to be at the "here" note.
/* This function does the Busy-Waiting for an MRC instruction.  */

ARMword
ARMul_MRC (ARMul_State * state, ARMword instr)
{
  unsigned cpab;
  ARMword result = 0;

  if (! CP_ACCESS_ALLOWED (state, CPNum))
    {
      ARMul_UndefInstr (state, instr);
      return(0); // <-- here
    }

  cpab = (state->MRC[CPNum]) (state, ARMul_FIRST, instr, &result);
  while (cpab == ARMul_BUSY)
    {
      ARMul_Icycles (state, 1, 0);
      if (IntPending (state))
 {
   cpab = (state->MRC[CPNum]) (state, ARMul_INTERRUPT, instr, 0);
   return (0);
 }
      else
 cpab = (state->MRC[CPNum]) (state, ARMul_BUSY, instr, &result);
    }
  if (cpab == ARMul_CANT)
    {
      ARMul_Abort (state, ARMul_UndefinedInstrV);
      /* Parent will destroy the flags otherwise.  */
      result = ECC;
    }
  else
    {
      BUSUSEDINCPCN;
      ARMul_Ccycles (state, 1, 0);
      ARMul_Icycles (state, 1, 0);
    }

  return result;
}

No comments:

Post a Comment