summaryrefslogtreecommitdiff
path: root/gdb/linux-nat.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2011-05-13 17:31:07 +0000
committerDoug Evans <dje@google.com>2011-05-13 17:31:07 +0000
commit01124a23b32e1d40eefe063aa416438d71ba0240 (patch)
tree5762327207e3693e5a4b2969c841df4165af4568 /gdb/linux-nat.c
parent6edba76fe8b37bf2a8f7c84353aa0252724bf293 (diff)
downloadbinutils-gdb-01124a23b32e1d40eefe063aa416438d71ba0240.tar.gz
* linux-nat.c (debug_linux_nat_async): Delete.
Replace all references to use debug_linux_nat instead. (show_debug_linux_nat_async): Delete. (sigchld_handler): Call ui_file_write_async_safe instead of fprintf_unfiltered. (_initialize_linux_nat): Remove `set debug lin-lwp-async'. * ui-file.c (struct ui_file): New member to_write_async_safe. (null_file_write_async_safe): New function. (ui_file_write_async_safe): New function. (set_ui_file_write_async_safe): New function. (ui_file_new): Initialize to_write_async_safe. (stdio_file_write_async_safe): New function. (struct stdio_file): New member fd. (stdio_file_new): Initialize to_write_async_safe, fd. (stdio_file_read, stdio_file_isatty): New stdio->fd instead of calling fileno. * ui-file.h (ui_file_write_async_safe_ftype): New typedef. (set_ui_file_write_async_safe): Declare. (ui_file_write_async_safe): Declare. doc/ * gdb.texinfo (Completion): Update example. (Debugging Output): Delete `set/show debug lin-lwp-async'.
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r--gdb/linux-nat.c34
1 files changed, 8 insertions, 26 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 641a619727c..4c4db3bc061 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -198,16 +198,6 @@ show_debug_linux_nat (struct ui_file *file, int from_tty,
value);
}
-static int debug_linux_nat_async = 0;
-static void
-show_debug_linux_nat_async (struct ui_file *file, int from_tty,
- struct cmd_list_element *c, const char *value)
-{
- fprintf_filtered (file,
- _("Debugging of GNU/Linux async lwp module is %s.\n"),
- value);
-}
-
static int disable_randomization = 1;
static void
@@ -3260,7 +3250,7 @@ linux_nat_wait_1 (struct target_ops *ops,
int status = 0;
pid_t pid;
- if (debug_linux_nat_async)
+ if (debug_linux_nat)
fprintf_unfiltered (gdb_stdlog, "LLW: enter\n");
/* The first time we get here after starting a new inferior, we may
@@ -3303,7 +3293,7 @@ retry:
{
ourstatus->kind = TARGET_WAITKIND_IGNORE;
- if (debug_linux_nat_async)
+ if (debug_linux_nat)
fprintf_unfiltered (gdb_stdlog, "LLW: exit (no resumed LWP)\n");
restore_child_signals_mask (&prev_mask);
@@ -3546,7 +3536,7 @@ retry:
/* No interesting event. */
ourstatus->kind = TARGET_WAITKIND_IGNORE;
- if (debug_linux_nat_async)
+ if (debug_linux_nat)
fprintf_unfiltered (gdb_stdlog, "LLW: exit (ignore)\n");
restore_child_signals_mask (&prev_mask);
@@ -3561,7 +3551,7 @@ retry:
/* No interesting event for PID yet. */
ourstatus->kind = TARGET_WAITKIND_IGNORE;
- if (debug_linux_nat_async)
+ if (debug_linux_nat)
fprintf_unfiltered (gdb_stdlog, "LLW: exit (ignore)\n");
restore_child_signals_mask (&prev_mask);
@@ -3690,7 +3680,7 @@ retry:
else
store_waitstatus (ourstatus, status);
- if (debug_linux_nat_async)
+ if (debug_linux_nat)
fprintf_unfiltered (gdb_stdlog, "LLW: exit\n");
restore_child_signals_mask (&prev_mask);
@@ -5416,8 +5406,9 @@ sigchld_handler (int signo)
{
int old_errno = errno;
- if (debug_linux_nat_async)
- fprintf_unfiltered (gdb_stdlog, "sigchld\n");
+ if (debug_linux_nat)
+ ui_file_write_async_safe (gdb_stdlog,
+ "sigchld\n", sizeof ("sigchld\n") - 1);
if (signo == SIGCHLD
&& linux_nat_event_pipe[0] != -1)
@@ -5801,15 +5792,6 @@ Enables printf debugging output."),
show_debug_linux_nat,
&setdebuglist, &showdebuglist);
- add_setshow_zinteger_cmd ("lin-lwp-async", class_maintenance,
- &debug_linux_nat_async, _("\
-Set debugging of GNU/Linux async lwp module."), _("\
-Show debugging of GNU/Linux async lwp module."), _("\
-Enables printf debugging output."),
- NULL,
- show_debug_linux_nat_async,
- &setdebuglist, &showdebuglist);
-
/* Save this mask as the default. */
sigprocmask (SIG_SETMASK, NULL, &normal_mask);