From: Stu Grossman Date: Wed, 27 Apr 1994 05:50:42 +0000 (+0000) Subject: * nlm/gdbserve.c (putDebugChar): Install bug fix from i386-nlmstub. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5a3a28f2ae6779b6f76516a13d45a043f556ad8d;p=binutils-gdb.git * nlm/gdbserve.c (putDebugChar): Install bug fix from i386-nlmstub. * (hex2mem): Init ptr. * General cleanups to use ConsolePrintf, standard prologues, etc... --- diff --git a/gdb/nlm/gdbserve.c b/gdb/nlm/gdbserve.c index b97847f44b1..3c364c8995c 100644 --- a/gdb/nlm/gdbserve.c +++ b/gdb/nlm/gdbserve.c @@ -195,12 +195,12 @@ putDebugChar (c) int err; LONG put; - err = AIOWriteData (AIOhandle, (char *) &c, 1, &put); - if (err != 0 || put != 1) + put = 0; + while (put < 1) { - error_message = "AIOWriteData failed"; - ResumeThread (mainthread); - return 0; + err = AIOWriteData (AIOhandle, (char *) &c, 1, &put); + if (err != 0) + ConsolePrintf ("AIOWriteData: err = %d, put = %d\r\n", err, put); } return 1; } @@ -212,7 +212,7 @@ frame_to_registers (frame, regs) struct StackFrame *frame; char *regs; { - mem2hex (&frame->ExceptionRegs[SF_REG_PC], ®s[PC_REGNUM * 8 * 2], 8, 0); + mem2hex (&frame->ExceptionRegs[SF_REG_PC], ®s[PC_REGNUM * 8 * 2], 8 * 1, 0); mem2hex (&frame->ExceptionRegs[SF_IREG_OFFSET], ®s[V0_REGNUM * 8 * 2], 8 * 64, 0); } @@ -224,7 +224,7 @@ registers_to_frame (regs, frame) char *regs; struct StackFrame *frame; { - hex2mem (®s[PC_REGNUM * 8 * 2], &frame->ExceptionRegs[SF_REG_PC], 8, 0); + hex2mem (®s[PC_REGNUM * 8 * 2], &frame->ExceptionRegs[SF_REG_PC], 8 * 1, 0); hex2mem (®s[V0_REGNUM * 8 * 2], &frame->ExceptionRegs[SF_IREG_OFFSET], 8 * 64, 0); } @@ -473,7 +473,7 @@ hex2mem (buf, mem, count, may_fault) { int i; unsigned char ch; - char *ptr; + char *ptr = mem; mem_may_fault = may_fault; for (i=0;i 0) - fprintf (stderr, "About to call LoadModule with \"%s\" %08x\r\n", - cmdlin, __GetScreenID (GetCurrentScreen())); + ConsolePrintf ("About to call LoadModule with \"%s\" %08x\r\n", + cmdlin, __GetScreenID (GetCurrentScreen())); /* Start up the module to be debugged. */ err = LoadModule ((struct ScreenStruct *) __GetScreenID (GetCurrentScreen()), @@ -1086,10 +1087,10 @@ main (argc, argv) /* Wait for the debugger to wake us up. */ if (remote_debug > 0) - fprintf (stderr, "Suspending main thread (%08x)\r\n", mainthread); + ConsolePrintf ("Suspending main thread (%08x)\r\n", mainthread); SuspendThread (mainthread); if (remote_debug > 0) - fprintf (stderr, "Resuming main thread (%08x)\r\n", mainthread); + ConsolePrintf ("Resuming main thread (%08x)\r\n", mainthread); /* If we are woken up, print an optional error message, deregister ourselves and exit. */