Add -b, --no-signals to silence signal print outs.
diff --git a/ChangeLog b/ChangeLog
index dd863f0..fa421cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -49,9 +49,11 @@
* debug.h: Add macro guard.
* breakpoints.c: Fix MIPS breakpoints.
-2010-09-30 Zach Welch <zwelch@codesourcery.com>
+2009-10-06 Joe Damato <ice799@gmail.com>
- * Improve ARM syscall_p to handle Thumb-2 syscalls.
+ * handle_event.c: Do not print signals when -b is used.
+ * options.h, options.c: A new option (-b) was added.
+ * ltrace.1: Documentation for -b was added.
2009-09-07 Joe Damato <ice799@gmail.com>
diff --git a/handle_event.c b/handle_event.c
index 728ab65..1107cf0 100644
--- a/handle_event.c
+++ b/handle_event.c
@@ -330,7 +330,7 @@
remove_proc(event->proc);
return;
}
- if (event->proc->state != STATE_IGNORED) {
+ if (event->proc->state != STATE_IGNORED && !options.no_signals) {
output_line(event->proc, "--- %s (%s) ---",
shortsignal(event->proc, event->e_un.signum),
strsignal(event->e_un.signum));
diff --git a/ltrace.1 b/ltrace.1
index 228bede..a96fc34 100644
--- a/ltrace.1
+++ b/ltrace.1
@@ -6,7 +6,7 @@
.SH SYNOPSIS
.B ltrace
-.I "[-CfghiLrStttV] [-a column] [-A maxelts] [-D level] [-e expr] [-l filename] [-n nr] [-o filename] [-p pid] ... [-s strsize] [-u username] [-X extern] [-x extern] ... [--align=column] [--debug=level] [--demangle] [--help] [--indent=nr] [--library=filename] [--output=filename] [--version] [command [arg ...]]"
+.I "[-bCfghiLrStttV] [-a column] [-A maxelts] [-D level] [-e expr] [-l filename] [-n nr] [-o filename] [-p pid] ... [-s strsize] [-u username] [-X extern] [-x extern] ... [--align=column] [--debug=level] [--demangle] [--help] [--indent=nr] [--library=filename] [--output=filename] [--version] [command [arg ...]]"
.SH DESCRIPTION
.B ltrace
@@ -30,6 +30,9 @@
.I \-A maxelts
Maximum number of array elements to print before suppressing the rest with an ellipsis ("...")
.TP
+.I \-b, \-\-no-signals
+Disable printing of signals recieved by the traced process.
+.TP
.I \-c
Count time and calls for each library call and report a summary on program exit.
.TP
diff --git a/options.c b/options.c
index 604ff68..8589572 100644
--- a/options.c
+++ b/options.c
@@ -75,6 +75,7 @@
"Trace library calls of a given program.\n\n"
" -a, --align=COLUMN align return values in a secific column.\n"
" -A ARRAYLEN maximum number of array elements to print.\n"
+ " -b, --no-signals don't print signals.\n"
" -c count time and calls, and report a summary on exit.\n"
# ifdef USE_DEMANGLE
" -C, --demangle decode low-level symbol names into user-level names.\n"
@@ -181,6 +182,7 @@
progname = argv[0];
options.output = stderr;
options.no_plt = 0;
+ options.no_signals = 0;
guess_cols();
@@ -201,9 +203,10 @@
{"output", 1, 0, 'o'},
{"version", 0, 0, 'V'},
{"no-plt", 0, 0, 'g'},
+ {"no-signals", 0, 0, 'b'},
{0, 0, 0, 0}
};
- c = getopt_long(argc, argv, "+cfhiLrStTVg"
+ c = getopt_long(argc, argv, "+cfhiLrStTVgb"
# ifdef USE_DEMANGLE
"C"
# endif
@@ -358,6 +361,9 @@
"version 2 or later for copying conditions. There is NO warranty.\n");
exit(0);
break;
+ case 'b':
+ options.no_signals = 1;
+ break;
case 'X':
#ifdef PLT_REINITALISATION_BP
PLTs_initialized_by_here = optarg;
diff --git a/options.h b/options.h
index b74b495..e2d0e7f 100644
--- a/options.h
+++ b/options.h
@@ -2,19 +2,20 @@
#include <sys/types.h>
struct options_t {
- int align; /* -a: default alignment column for results */
- char * user; /* -u: username to run command as */
- int syscalls; /* -S: display system calls */
- int libcalls; /* -L: display library calls */
- int demangle; /* -C: demangle low-level names into user-level names */
- int indent; /* -n: indent trace output according to program flow */
- FILE *output; /* output to a specific file */
- int summary; /* count time, calls, and report a summary on program exit */
- int debug; /* debug */
- int arraylen; /* default maximum # of array elements printed */
- int strlen; /* default maximum # of bytes printed in strings */
- int follow; /* trace child processes */
- int no_plt; /* set bps on PLT entries */
+ int align; /* -a: default alignment column for results */
+ char * user; /* -u: username to run command as */
+ int syscalls; /* -S: display system calls */
+ int libcalls; /* -L: display library calls */
+ int demangle; /* -C: demangle low-level names into user-level names */
+ int indent; /* -n: indent trace output according to program flow */
+ FILE *output; /* output to a specific file */
+ int summary; /* count time, calls, and report a summary on program exit */
+ int debug; /* debug */
+ int arraylen; /* default maximum # of array elements printed */
+ int strlen; /* default maximum # of bytes printed in strings */
+ int follow; /* trace child processes */
+ int no_plt; /* set bps on PLT entries */
+ int no_signals; /* don't print signals */
};
extern struct options_t options;