diff options
author | Thomas Lord <lord@cygnus> | 1993-11-01 22:25:23 +0000 |
---|---|---|
committer | Thomas Lord <lord@cygnus> | 1993-11-01 22:25:23 +0000 |
commit | 199b2450f62ad6ffbe56ec34fc447716b811579d (patch) | |
tree | 07400f3981865f129b912a51b85e69b7b8d1ee22 /gdb/inflow.c | |
parent | b3c0fc577b17083c8bdc3ed5cffc4ca50aefaa5e (diff) | |
download | gdb-199b2450f62ad6ffbe56ec34fc447716b811579d.zip gdb-199b2450f62ad6ffbe56ec34fc447716b811579d.tar.gz gdb-199b2450f62ad6ffbe56ec34fc447716b811579d.tar.bz2 |
Change the stream argument to _filtered to GDB_FILE *.
Change all references to stdout/stderr to gdb_stdout/gdb_stderr.
Replace all calls to stdio output functions with calls to
corresponding _unfiltered functions (`fprintf_unfiltered')
Replaced calls to fopen for output to gdb_fopen.
Added sufficient goo to utils.c and defs.h to make the above work.
The net effect is that stdio output functions are only directly used
in utils.c. Elsewhere, the _unfiltered and _filtered functions and
GDB_FILE type are used.
In the near future, GDB_FILE will stop being equivalant to FILE.
The semantics of some commands has changed in a very subtle way:
called in the right context, they may cause new occurences of
prompt_for_continue() behavior. The testsuite doesn't notice anything
like this, though.
Please respect this change by not reintroducing stdio output
dependencies in the main body of gdb code. All output from commands
should go to a GDB_FILE.
Target-specific code can still use stdio directly to communicate with
targets.
Diffstat (limited to 'gdb/inflow.c')
-rw-r--r-- | gdb/inflow.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gdb/inflow.c b/gdb/inflow.c index bf79541..cd0105e 100644 --- a/gdb/inflow.c +++ b/gdb/inflow.c @@ -25,6 +25,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "serial.h" #include "terminal.h" #include "target.h" +#include "thread.h" #include <signal.h> #include <fcntl.h> @@ -146,6 +147,9 @@ gdb_has_a_terminal () } return gdb_has_a_terminal_flag == yes; + default: + /* "Can't happen". */ + return 0; } } @@ -153,7 +157,7 @@ gdb_has_a_terminal () #define OOPSY(what) \ if (result == -1) \ - fprintf(stderr, "[%s failed in terminal_inferior: %s]\n", \ + fprintf_unfiltered(gdb_stderr, "[%s failed in terminal_inferior: %s]\n", \ what, strerror (errno)) static void terminal_ours_1 PARAMS ((int)); @@ -331,7 +335,7 @@ terminal_ours_1 (output_only) used to check for an error here, so perhaps there are other such situations as well. */ if (result == -1) - fprintf (stderr, "[tcsetpgrp failed in terminal_ours: %s]\n", + fprintf_unfiltered (gdb_stderr, "[tcsetpgrp failed in terminal_ours: %s]\n", strerror (errno)); #endif #endif /* termios */ @@ -528,12 +532,14 @@ kill_command (arg, from_tty) error ("Not confirmed."); target_kill (); + init_thread_list(); /* Destroy thread info */ + /* Killing off the inferior can leave us with a core file. If so, print the state we are left in. */ if (target_has_stack) { printf_filtered ("In %s,\n", current_target->to_longname); if (selected_frame == NULL) - fputs_filtered ("No selected stack frame.\n", stdout); + fputs_filtered ("No selected stack frame.\n", gdb_stdout); else print_stack_frame (selected_frame, selected_frame_level, 1); } |