diff options
author | Petr Machata <pmachata@redhat.com> | 2012-01-06 16:00:25 +0100 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2012-08-29 19:02:06 +0200 |
commit | 37b73c0ab8cbcab4729df6d12f2dc846d4652310 (patch) | |
tree | 6b63483ff05e82922e87488cdf9415c59a47fb85 /output.c | |
parent | 97f13e3fca546aa292ba5d8aa6011338e64f2f7a (diff) | |
download | ltrace-37b73c0ab8cbcab4729df6d12f2dc846d4652310.tar.gz |
Drop LT_TOF_NONE, LT_TOF_STRUCT
Diffstat (limited to 'output.c')
-rw-r--r-- | output.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -56,7 +56,8 @@ output_indent(struct Process *proc) } static void -begin_of_line(enum tof type, Process *proc) { +begin_of_line(Process *proc, int is_func, int indent) +{ current_column = 0; if (!proc) { return; @@ -112,15 +113,14 @@ begin_of_line(enum tof type, Process *proc) { } } if (opt_i) { - if (type == LT_TOF_FUNCTION || type == LT_TOF_FUNCTIONR) { + if (is_func) current_column += fprintf(options.output, "[%p] ", proc->return_addr); - } else { + else current_column += fprintf(options.output, "[%p] ", proc->instruction_pointer); - } } - if (options.indent > 0 && type != LT_TOF_NONE) { + if (options.indent > 0 && indent) { output_indent(proc); } } @@ -166,7 +166,7 @@ output_line(Process *proc, char *fmt, ...) { if (!fmt) { return; } - begin_of_line(LT_TOF_NONE, proc); + begin_of_line(proc, 0, 0); va_start(args, fmt); vfprintf(options.output, fmt, args); @@ -201,7 +201,7 @@ output_left(enum tof type, struct Process *proc, } current_proc = proc; current_depth = proc->callstack_depth; - begin_of_line(type, proc); + begin_of_line(type, type == LT_TOF_FUNCTION, 1); if (!options.hide_caller && libsym->lib != NULL && libsym->plt_type != LS_TOPLT_NONE) current_column += fprintf(options.output, "%s->", @@ -319,7 +319,7 @@ output_right(enum tof type, struct Process *proc, struct library_symbol *libsym) current_proc = 0; } if (current_proc != proc) { - begin_of_line(type, proc); + begin_of_line(proc, type == LT_TOF_FUNCTIONR, 1); #ifdef USE_DEMANGLE current_column += fprintf(options.output, "<... %s resumed> ", |