* Rename remote-es1800.c to remote-es.c
[deliverable/binutils-gdb.git] / gdb / remote-udi.c
index 9615112c8e626df6062cf48d97acc5b7fb141039..6b586cb7da7d667ff2d21bfdf50c3c96c95a5b51 100644 (file)
@@ -81,7 +81,7 @@ char   CoffFileName[100] = "";
 #define TYPE_A29050     3
 static  char *processor_name[] = { "Unknown", "Am29000", "Am29030", "Am29050" };
 static  int processor_type=TYPE_UNKNOWN;
-#define FREEZE_MODE     (read_register(CPS_REGNUM) && 0x400)
+#define FREEZE_MODE     (read_register(CPS_REGNUM) & 0x400)
 #define USE_SHADOW_PC  ((processor_type == TYPE_A29050) && FREEZE_MODE) 
 
 #define LLOG_FILE "udi.log"
@@ -405,8 +405,8 @@ udi_attach (args, from_tty)
       printf ("Attaching to remote program %s...\n", prog_name);
 
   UDIStop();
-  From.Space = 11;
-  From.Offset = UDI29KSpecialRegs;
+  From.Space = UDI29KSpecialRegs;
+  From.Offset = 11;
   if (err = UDIRead(From, &PC_adds, Count, Size, &CountDone, HostEndian))
     error ("UDIRead failed in udi_attach");
   printf ("Remote process is now halted, pc1 = 0x%x.\n", PC_adds);
@@ -494,7 +494,7 @@ udi_wait (status)
        {
        case UDIStdoutReady:
          if (UDIGetStdout (sbuf, (UDISizeT)SBUF_MAX, &CountDone))
-           error ("UDIGetStdin() failed in udi_wait");
+           error ("UDIGetStdout() failed in udi_wait");
          fwrite (sbuf, 1, CountDone, stdout);
          fflush(stdout);
          continue;
@@ -504,9 +504,13 @@ udi_wait (status)
          fflush(stderr);
          continue;
        case UDIStdinNeeded:
-         printf("DEBUG: stdin requested ... continue\n");
-         /*    UDIPutStdin(sbuf, (UDISizeT)i, &CountDone); */
+         scanf ("%s", sbuf);
+         i = strlen (sbuf);
+         UDIPutStdin (sbuf, (UDISizeT)i, &CountDone);
          continue;
+       case UDIRunning:
+         /* In spite of the fact that we told UDIWait to wait forever, it will
+            return spuriously sometimes.  */
        case UDIStdinModeX:
          continue;
        default:
@@ -575,14 +579,11 @@ udi_wait (status)
     case UDINotExecuting:
       WSETSTOP ((*status), SIGTERM);
       break;
-    case UDIRunning:
-      WSETSTOP ((*status), SIGILL);
-      break;
     case UDIStopped:
       WSETSTOP ((*status), SIGTSTP);
       break;
     case UDIWarned:
-      WSETSTOP ((*status), SIGLOST);
+      WSETSTOP ((*status), SIGURG);
       break;
     case UDIStepped:
     case UDIBreak:
@@ -1035,9 +1036,9 @@ download(load_arg_string, from_tty)
        {
          token++;
 
-         if (strcmp (token, "ms") == 0)
+         if (STREQ (token, "ms"))
            stack_sizes[1] = atol (strtok (NULL, " \t"));
-         else if (strcmp (token, "rs") == 0)
+         else if (STREQ (token, "rs"))
            stack_sizes[0] = atol (strtok (NULL, " \t"));
          else
            {
@@ -1094,13 +1095,13 @@ download(load_arg_string, from_tty)
          const char *section_name;
 
          section_name = bfd_get_section_name (pbfd, section);
-         if (strcmp (section_name, ".text") == 0 && !load_text)
+         if (STREQ (section_name, ".text") && !load_text)
            continue;
-         else if (strcmp (section_name, ".data") == 0 && !load_data)
+         else if (STREQ (section_name, ".data") && !load_data)
            continue;
-         else if (strcmp (section_name, ".bss") == 0 && !load_bss)
+         else if (STREQ (section_name, ".bss") && !load_bss)
            continue;
-         else if (strcmp (section_name, ".lit") == 0 && !load_lit)
+         else if (STREQ (section_name, ".lit") && !load_lit)
            continue;
 
          To.Offset = bfd_get_section_vma (pbfd, section);
This page took 0.025165 seconds and 4 git commands to generate.