From b8ec8d4ab0764d664231e80efb5c55a71171f096 Mon Sep 17 00:00:00 2001 From: Stan Shebs Date: Wed, 22 Jun 1994 19:57:02 +0000 Subject: * mpw-make.in (VERSION): Update to 4.12.3. (SiowGDB): New target, GDB using SIOW library. (init-new.c): New target, attempt to generate init.c from sources. (main.c.o, top.c.o): Put each in its own segment. * main.c (main) [MPW]: Always call mac_init. * utils.c (query) [MPW]: Always return "yes" if in MacGDB, output an extra newline otherwise. * mac-xdep.c: More comments in various places, remove junk. (mac_init): Add tests for MPW and SIOW. (use_wne, has_color_qd): Renamed. (use_color_qd): New variable. (grow_window): Only do console resizing to console window, call resize_console_window. (zoom_window): Call resize_console_window. (resize_console_window, scroll_text): New functions. (adjust_console_sizes): Always align viewrect to even multiples of text lines. (adjust_console_text): Always scroll by whole lines. (hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a recalculation of scroll positions if a newline was output. (hacked_fflush): Similarly, for flushing. (hacked_fgetc): New function, aborts if called in MacGDB. * ser-mac.c (mac_readchar): Rename starttime to start_time, remove debugging printf. (mac_write): Sleep on first 4 writes. (sec_sleep): New function, works like standard sleep. * macgdb.r: Adjust positioning and contents of About box. Set minimum size to 2000K, preferred size to 5000K. * config/m68k/xm-mpw.h (fgetc): Define as a macro. --- gdb/ser-mac.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'gdb/ser-mac.c') diff --git a/gdb/ser-mac.c b/gdb/ser-mac.c index 3be1fb3..d502ad1 100644 --- a/gdb/ser-mac.c +++ b/gdb/ser-mac.c @@ -152,7 +152,7 @@ mac_readchar (scb, timeout) int timeout; { int status, n; - /* time_t */ unsigned long starttime, now; + /* time_t */ unsigned long start_time, now; OSErr err; CntrlParam cb; IOParam pb; @@ -160,7 +160,7 @@ mac_readchar (scb, timeout) if (scb->bufcnt-- > 0) return *scb->bufp++; - time (&starttime); + time (&start_time); while (1) { @@ -190,10 +190,8 @@ mac_readchar (scb, timeout) else { time (&now); - if (now > starttime + timeout) { - printf_unfiltered ("start %u, now %u, timeout %d\n", starttime, now, timeout); + if (now > start_time + timeout) return SERIAL_TIMEOUT; - } } } } @@ -257,9 +255,9 @@ mac_write (scb, str, len) OSErr err; IOParam pb; - if (first_mac_write++ < 8) + if (first_mac_write++ < 4) { - sleep (1); + sec_sleep (1); } pb.ioRefNum = output_refnum; pb.ioBuffer = (Ptr) str; @@ -272,9 +270,22 @@ mac_write (scb, str, len) return 0; } +sec_sleep (int timeout) +{ + unsigned long start_time, now; + + time (&start_time); + + while (1) + { + time (&now); + if (now > start_time + timeout) + return; + } +} + static void -mac_close (scb) - serial_t scb; +mac_close (serial_t scb) { if (input_refnum) { -- cgit v1.1