aboutsummaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
authorJuan Cespedes <cespedes@debian.org>2001-07-02 00:52:45 +0200
committerJuan Cespedes <cespedes@debian.org>2001-07-02 00:52:45 +0200
commit5b3ffdf2e696273d38434ff7b3c26349fff5a0ea (patch)
treee2dfad2260e9d75ab483d8e92ed82d916bf69f39 /options.c
parent2f93d96a05b3d2b38a777ff0333e803cc84f8feb (diff)
downloadltrace-5b3ffdf2e696273d38434ff7b3c26349fff5a0ea.tar.gz
Version: 0.3.11
* Clean up lintian bugs * Fixed small bug reading start of arguments in config file * Keep a stack of nested calls (Morten Eriksen, 1999-07-04) * Add "--indent" option (Morten Eriksen, 1999-07-04) * cleans up connection between a breakpoint address and a call instance (Morten Eriksen, 1999-07-04) * New Standards-Version (3.5.5)
Diffstat (limited to 'options.c')
-rw-r--r--options.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/options.c b/options.c
index a5b10a6..99dfa6a 100644
--- a/options.c
+++ b/options.c
@@ -32,6 +32,7 @@ int opt_t = 0; /* print absolute timestamp */
#if HAVE_LIBIBERTY
int opt_C = 0; /* Demangle low-level symbol names into user-level names */
#endif
+int opt_n = 0; /* indent trace output according to program flow */
/* List of pids given to option -p: */
struct opt_p_t * opt_p = NULL; /* attach to process with a given pid */
@@ -82,6 +83,11 @@ static void usage(void)
" -p PID attach to the process with the process ID pid.\n"
" -e expr modify which events to trace.\n"
# if HAVE_GETOPT_LONG
+" -n, --indent=NR indent output by NR spaces for each call level nesting.\n"
+# else
+" -n NR indent output by NR spaces for each call level nesting.\n"
+# endif
+# if HAVE_GETOPT_LONG
" -h, --help display this help and exit.\n"
# else
" -h display this help and exit.\n"
@@ -140,6 +146,7 @@ char ** process_options(int argc, char **argv)
# if HAVE_LIBIBERTY
{ "demangle", 0, 0, 'C'},
#endif
+ { "indent", 0, 0, 'n'},
{ "help", 0, 0, 'h'},
{ "output", 1, 0, 'o'},
{ "version", 0, 0, 'V'},
@@ -149,13 +156,13 @@ char ** process_options(int argc, char **argv)
# if HAVE_LIBIBERTY
"C"
# endif
- "a:s:o:u:p:e:", long_options, &option_index);
+ "a:s:o:u:p:e:n:", long_options, &option_index);
#else
c = getopt(argc, argv, "+dfiLSrthV"
# if HAVE_LIBIBERTY
"C"
# endif
- "a:s:o:u:p:e:");
+ "a:s:o:u:p:e:n:");
#endif
if (c==-1) {
break;
@@ -183,6 +190,8 @@ char ** process_options(int argc, char **argv)
break;
case 's': opt_s = atoi(optarg);
break;
+ case 'n': opt_n = atoi(optarg);
+ break;
case 'h': usage();
exit(0);
case 'o': output = fopen(optarg, "w");