More wrong uses of gdb_stderr and stderr/stdout.
More upddates to calls of catch_errors() so that call matches new interface.
This commit is contained in:
Andrew Cagney 1999-01-19 02:17:00 +00:00
parent ab0e22180a
commit bc8bd256d0
6 changed files with 39 additions and 19 deletions

View File

@ -1,3 +1,23 @@
Mon Jan 18 14:01:24 1999 Andrew Cagney <cagney@b1.cygnus.com>
* 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 <cagney@b1.cygnus.com>
* 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 <shebs@andros.cygnus.com> Mon Jan 18 16:40:50 1999 Stan Shebs <shebs@andros.cygnus.com>
* ser-ocd.c (ocd_open): Handle Unix case gracefully. * ser-ocd.c (ocd_open): Handle Unix case gracefully.

View File

@ -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, static int ocd_read_bytes PARAMS ((CORE_ADDR memaddr,
char *myaddr, int len)); 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)); static int readchar PARAMS ((int timeout));
@ -145,7 +145,7 @@ ocd_close (quitting)
static int static int
ocd_start_remote (dummy) ocd_start_remote (dummy)
char *dummy; PTR dummy;
{ {
unsigned char buf[10], *p; unsigned char buf[10], *p;
int pktlen; int pktlen;
@ -154,7 +154,7 @@ ocd_start_remote (dummy)
int speed; int speed;
enum ocd_target_type target_type; 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 */ 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. /* Start the remote connection; if error (0), discard this target.
In particular, if the user quits, be sure to discard it In particular, if the user quits, be sure to discard it
(we'd be in an inconsistent state otherwise). */ (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", "Couldn't establish connection to remote target\n",
RETURN_MASK_ALL)) RETURN_MASK_ALL))
{ {

View File

@ -625,9 +625,9 @@ array_open(args, name, from_tty)
log_file = fopen (LOG_FILE, "w"); log_file = fopen (LOG_FILE, "w");
if (log_file == NULL) if (log_file == NULL)
perror_with_name (LOG_FILE); perror_with_name (LOG_FILE);
fprintf_filtered (log_file, "GDB %s (%s", version); fprintf (log_file, "GDB %s (%s", version);
fprintf_filtered (log_file, " --target %s)\n", array_ops.to_shortname); fprintf (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, "Remote target %s connected to %s\n\n", array_ops.to_shortname, dev_name);
#endif #endif
/* see if the target is alive. For a ROM monitor, we can just try to force the /* see if the target is alive. For a ROM monitor, we can just try to force the

View File

@ -130,7 +130,7 @@ arm_rdi_start_remote (dummy)
void void
voiddummy () voiddummy ()
{ {
printf("void dummy\n"); fprintf_unfiltered (gdb_stdout, "void dummy\n");
} }
static void static void
@ -139,7 +139,7 @@ myprint (arg, format, ap)
const char *format; const char *format;
va_list ap; va_list ap;
{ {
vfprintf (stdout, format, ap); vfprintf_unfiltered (gdb_stdout, format, ap);
} }
static void static void
@ -148,7 +148,7 @@ mywritec (arg, c)
int c; int c;
{ {
if (isascii (c)) if (isascii (c))
fputc_unfiltered (c, (FILE *) arg); fputc_unfiltered (c, gdb_stdout);
} }
static int static int
@ -231,12 +231,12 @@ device is attached to the remote system (e.g. /dev/ttya).");
gdb_hostif.dbgprint = myprint; gdb_hostif.dbgprint = myprint;
gdb_hostif.dbgpause = mypause; gdb_hostif.dbgpause = mypause;
gdb_hostif.dbgarg = stdout; gdb_hostif.dbgarg = NULL;
gdb_hostif.writec = mywritec; gdb_hostif.writec = mywritec;
gdb_hostif.readc = myreadc; gdb_hostif.readc = myreadc;
gdb_hostif.write = mywrite; gdb_hostif.write = mywrite;
gdb_hostif.gets = mygets; gdb_hostif.gets = mygets;
gdb_hostif.hostosarg = stdout; gdb_hostif.hostosarg = NULL;
gdb_hostif.reset = voiddummy; gdb_hostif.reset = voiddummy;
rslt = angel_RDI_open (10, &gdb_config, &gdb_hostif, NULL); rslt = angel_RDI_open (10, &gdb_config, &gdb_hostif, NULL);

View File

@ -62,7 +62,7 @@ static void sds_fetch_registers PARAMS ((int));
static void sds_resume PARAMS ((int, int, enum target_signal)); 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)); static void sds_open PARAMS ((char *, int));
@ -155,7 +155,7 @@ sds_close (quitting)
static int static int
sds_start_remote (dummy) sds_start_remote (dummy)
char *dummy; PTR dummy;
{ {
char c; char c;
unsigned char buf[200]; 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. /* 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 particular, if the user quits, be sure to discard it (we'd be
in an inconsistent state otherwise). */ 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", "Couldn't establish connection to remote target\n",
RETURN_MASK_ALL)) RETURN_MASK_ALL))
pop_target (); pop_target ();

View File

@ -64,7 +64,7 @@
extern struct target_ops child_ops; extern struct target_ops child_ops;
static void child_stop PARAMS ((void)); 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 static int last_sig = 0; /* Set if a signal was received from the
debugged process */ debugged process */
@ -302,7 +302,7 @@ child_store_inferior_registers (int r)
of error; store status through argument pointer OURSTATUS. */ of error; store status through argument pointer OURSTATUS. */
static int static int
handle_load_dll (char *dummy) handle_load_dll (PTR dummy)
{ {
LOAD_DLL_DEBUG_INFO * event = &current_event.u.LoadDll; LOAD_DLL_DEBUG_INFO * event = &current_event.u.LoadDll;
DWORD dll_name_ptr; 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_mourn_inferior = child_mourn_inferior;
child_ops.to_can_run = child_can_run; child_ops.to_can_run = child_can_run;
child_ops.to_notice_signals = 0; 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_stop = child_stop;
child_ops.to_stratum = process_stratum; child_ops.to_stratum = process_stratum;
child_ops.DONT_USE = 0; child_ops.DONT_USE = 0;
@ -1102,7 +1102,7 @@ _initialize_inftarg ()
by "polling" it. If WaitForSingleObject returns WAIT_OBJECT_0 by "polling" it. If WaitForSingleObject returns WAIT_OBJECT_0
it means that the pid has died. Otherwise it is assumed to be alive. */ it means that the pid has died. Otherwise it is assumed to be alive. */
static int static int
child_thread_alive (int pid) win32_child_thread_alive (int pid)
{ {
return WaitForSingleObject(thread_rec (pid, FALSE)->h, 0) == WAIT_OBJECT_0 ? return WaitForSingleObject(thread_rec (pid, FALSE)->h, 0) == WAIT_OBJECT_0 ?
FALSE : TRUE; FALSE : TRUE;