#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"
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);
{
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;
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:
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:
{
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
{
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);