From bc8bd256d091376f708bdd7119b145407a3614b2 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Tue, 19 Jan 1999 02:17:00 +0000 Subject: [PATCH] HPMERGE: More wrong uses of gdb_stderr and stderr/stdout. More upddates to calls of catch_errors() so that call matches new interface. --- gdb/ChangeLog | 20 ++++++++++++++++++++ gdb/ocd.c | 8 ++++---- gdb/remote-array.c | 6 +++--- gdb/remote-rdi.c | 10 +++++----- gdb/remote-sds.c | 6 +++--- gdb/win32-nat.c | 8 ++++---- 6 files changed, 39 insertions(+), 19 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0735ccdbe94..9951ef10156 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,23 @@ +Mon Jan 18 14:01:24 1999 Andrew Cagney + + * remote-array.c (array_open): Don't use fprintf_filtered to send + data to the log file. + + * remote-array.c (handle_load_dll): Change argument type to PTR so + that it is compatible with catch_errors. + * ocd.c (ocd_start_remote): Ditto. + * remote-sds.c (sds_start_remote): Ditto. + + * win32-nat.c (win32_child_thread_alive): Namespace proof + child_thread_alive. + (init_child_ops): Update. + +Mon Jan 18 12:03:47 1999 Andrew Cagney + + * remote-rdi.c (arm_rdi_open): Set gdb_hostif.hostosarg and + gdb_hostif.dbgarg to NULL instead of stdout. + (voiddummy, myprint, mywritec): Use gdb_stdout instead of stdout. + Mon Jan 18 16:40:50 1999 Stan Shebs * ser-ocd.c (ocd_open): Handle Unix case gracefully. diff --git a/gdb/ocd.c b/gdb/ocd.c index 0af8103a730..343fa627e4f 100644 --- a/gdb/ocd.c +++ b/gdb/ocd.c @@ -41,7 +41,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ static int ocd_read_bytes PARAMS ((CORE_ADDR memaddr, char *myaddr, int len)); -static int ocd_start_remote PARAMS ((char *dummy)); +static int ocd_start_remote PARAMS ((PTR dummy)); static int readchar PARAMS ((int timeout)); @@ -145,7 +145,7 @@ ocd_close (quitting) static int ocd_start_remote (dummy) - char *dummy; + PTR dummy; { unsigned char buf[10], *p; int pktlen; @@ -154,7 +154,7 @@ ocd_start_remote (dummy) int speed; enum ocd_target_type target_type; - target_type = (enum ocd_target_type)dummy; + target_type = *(enum ocd_target_type*)dummy; immediate_quit = 1; /* Allow user to interrupt it */ @@ -330,7 +330,7 @@ device the OCD device is attached to (e.g. /dev/ttya)."); /* Start the remote connection; if error (0), discard this target. In particular, if the user quits, be sure to discard it (we'd be in an inconsistent state otherwise). */ - if (!catch_errors (ocd_start_remote, (char *)target_type, + if (!catch_errors (ocd_start_remote, &target_type, "Couldn't establish connection to remote target\n", RETURN_MASK_ALL)) { diff --git a/gdb/remote-array.c b/gdb/remote-array.c index 2b9531ac85c..413827ab982 100644 --- a/gdb/remote-array.c +++ b/gdb/remote-array.c @@ -625,9 +625,9 @@ array_open(args, name, from_tty) log_file = fopen (LOG_FILE, "w"); if (log_file == NULL) perror_with_name (LOG_FILE); - fprintf_filtered (log_file, "GDB %s (%s", version); - fprintf_filtered (log_file, " --target %s)\n", array_ops.to_shortname); - fprintf_filtered (log_file, "Remote target %s connected to %s\n\n", array_ops.to_shortname, dev_name); + fprintf (log_file, "GDB %s (%s", version); + fprintf (log_file, " --target %s)\n", array_ops.to_shortname); + fprintf (log_file, "Remote target %s connected to %s\n\n", array_ops.to_shortname, dev_name); #endif /* see if the target is alive. For a ROM monitor, we can just try to force the diff --git a/gdb/remote-rdi.c b/gdb/remote-rdi.c index 7b6511e1e7b..dba920e36f2 100644 --- a/gdb/remote-rdi.c +++ b/gdb/remote-rdi.c @@ -130,7 +130,7 @@ arm_rdi_start_remote (dummy) void voiddummy () { - printf("void dummy\n"); + fprintf_unfiltered (gdb_stdout, "void dummy\n"); } static void @@ -139,7 +139,7 @@ myprint (arg, format, ap) const char *format; va_list ap; { - vfprintf (stdout, format, ap); + vfprintf_unfiltered (gdb_stdout, format, ap); } static void @@ -148,7 +148,7 @@ mywritec (arg, c) int c; { if (isascii (c)) - fputc_unfiltered (c, (FILE *) arg); + fputc_unfiltered (c, gdb_stdout); } static int @@ -231,12 +231,12 @@ device is attached to the remote system (e.g. /dev/ttya)."); gdb_hostif.dbgprint = myprint; gdb_hostif.dbgpause = mypause; - gdb_hostif.dbgarg = stdout; + gdb_hostif.dbgarg = NULL; gdb_hostif.writec = mywritec; gdb_hostif.readc = myreadc; gdb_hostif.write = mywrite; gdb_hostif.gets = mygets; - gdb_hostif.hostosarg = stdout; + gdb_hostif.hostosarg = NULL; gdb_hostif.reset = voiddummy; rslt = angel_RDI_open (10, &gdb_config, &gdb_hostif, NULL); diff --git a/gdb/remote-sds.c b/gdb/remote-sds.c index 05aa8294f70..c8fe721e7b1 100644 --- a/gdb/remote-sds.c +++ b/gdb/remote-sds.c @@ -62,7 +62,7 @@ static void sds_fetch_registers PARAMS ((int)); static void sds_resume PARAMS ((int, int, enum target_signal)); -static int sds_start_remote PARAMS ((char *)); +static int sds_start_remote PARAMS ((PTR)); static void sds_open PARAMS ((char *, int)); @@ -155,7 +155,7 @@ sds_close (quitting) static int sds_start_remote (dummy) - char *dummy; + PTR dummy; { char c; unsigned char buf[200]; @@ -237,7 +237,7 @@ device is attached to the remote system (e.g. /dev/ttya)."); /* Start the remote connection; if error (0), discard this target. In particular, if the user quits, be sure to discard it (we'd be in an inconsistent state otherwise). */ - if (!catch_errors (sds_start_remote, (char *)0, + if (!catch_errors (sds_start_remote, NULL, "Couldn't establish connection to remote target\n", RETURN_MASK_ALL)) pop_target (); diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c index e0f07ef1178..47dbc55e7da 100644 --- a/gdb/win32-nat.c +++ b/gdb/win32-nat.c @@ -64,7 +64,7 @@ extern struct target_ops child_ops; static void child_stop PARAMS ((void)); -static int child_thread_alive PARAMS ((int)); +static int win32_child_thread_alive PARAMS ((int)); static int last_sig = 0; /* Set if a signal was received from the debugged process */ @@ -302,7 +302,7 @@ child_store_inferior_registers (int r) of error; store status through argument pointer OURSTATUS. */ static int -handle_load_dll (char *dummy) +handle_load_dll (PTR dummy) { LOAD_DLL_DEBUG_INFO * event = ¤t_event.u.LoadDll; DWORD dll_name_ptr; @@ -1033,7 +1033,7 @@ static void init_child_ops(void) child_ops.to_mourn_inferior = child_mourn_inferior; child_ops.to_can_run = child_can_run; child_ops.to_notice_signals = 0; - child_ops.to_thread_alive = child_thread_alive; + child_ops.to_thread_alive = win32_child_thread_alive; child_ops.to_stop = child_stop; child_ops.to_stratum = process_stratum; child_ops.DONT_USE = 0; @@ -1102,7 +1102,7 @@ _initialize_inftarg () by "polling" it. If WaitForSingleObject returns WAIT_OBJECT_0 it means that the pid has died. Otherwise it is assumed to be alive. */ static int -child_thread_alive (int pid) +win32_child_thread_alive (int pid) { return WaitForSingleObject(thread_rec (pid, FALSE)->h, 0) == WAIT_OBJECT_0 ? FALSE : TRUE; -- 2.30.2