supply_register (regno, (char *) &buf);
regcache_raw_supply (current_regcache, regno, (char *) &buf);
e7000_wait (ptid_t ptid, struct target_waitstatus *status){  int stop_reason;  int regno;  int running_count = 0;  int had_sleep = 0;  int loop = 1;  char *wanted_nopc = NULL;  /* Then echo chars until PC= string seen */  gch ();			/* Drop cr */  gch ();			/* and space */  while (loop)    {      switch (expect_n (estrings))	{	case WAS_OTHER:	  /* how did this happen ? */	  loop = 0;	  break;	case WAS_SLEEP:	  had_sleep = 1;	  putchar_e7000 (CTRLC);	  loop = 0;	  break;	case WAS_INT:	  loop = 0;	  break;	case WAS_RUNNING:	  running_count++;	  if (running_count == 20)	    {	      printf_unfiltered ("[running...]\n");	      running_count = 0;	    }	  break;	default:	  /* error? */	  break;	}    }  /* Skip till the PC= */  expect ("=");  if (TARGET_ARCHITECTURE->arch == bfd_arch_sh)    {      wanted_nopc = want_nopc_sh;      switch (TARGET_ARCHITECTURE->mach)	{	case bfd_mach_sh3:	case bfd_mach_sh3e:	case bfd_mach_sh4:	  wanted_nopc = want_nopc_sh3;	}    }  if (TARGET_ARCHITECTURE->arch == bfd_arch_h8300)    {      wanted_nopc = want_nopc_h8300h;      switch (TARGET_ARCHITECTURE->mach)	{	case bfd_mach_h8300s:	case bfd_mach_h8300sn:	case bfd_mach_h8300sx:	case bfd_mach_h8300sxn:	  wanted_nopc = want_nopc_h8300s;	}    }  fetch_regs_from_dump (gch, wanted_nopc);  /* And supply the extra ones the simulator uses */  for (regno = NUM_REALREGS; regno < NUM_REGS; regno++)    {      int buf = 0;      supply_register (regno, (char *) &buf);    }  stop_reason = why_stop ();  expect_full_prompt ();  status->kind = TARGET_WAITKIND_STOPPED;  status->value.sig = TARGET_SIGNAL_TRAP;  switch (stop_reason)    {    case 1:			/* Breakpoint */      write_pc (read_pc ());	/* PC is always off by 2 for breakpoints */      status->value.sig = TARGET_SIGNAL_TRAP;      break;    case 0:			/* Single step */      status->value.sig = TARGET_SIGNAL_TRAP;      break;    case 2:			/* Interrupt */      if (had_sleep)	{	  status->value.sig = TARGET_SIGNAL_TRAP;	  sub2_from_pc ();	}      else	{	  status->value.sig = TARGET_SIGNAL_INT;	}      break;    case 3:      break;    case 4:      printf_unfiltered ("a cycle address error?\n");      status->value.sig = TARGET_SIGNAL_UNKNOWN;      break;    case 5:      status->value.sig = TARGET_SIGNAL_ILL;      break;    case 6:      status->value.sig = TARGET_SIGNAL_SEGV;      break;    case 7:			/* Anything else (NITEMS + 1) */      printf_unfiltered ("a write protect error?\n");      status->value.sig = TARGET_SIGNAL_UNKNOWN;      break;    default:      /* Get the user's attention - this should never happen. */      internal_error (__FILE__, __LINE__, "failed internal consistency check");    }  return inferior_ptid;}