summaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2014-01-07 21:00:44 +0100
committerChanho Park <chanho61.park@samsung.com>2014-08-22 20:38:24 +0900
commit7f40999b3db608961a2ddf59b9c56b611a856611 (patch)
treeb9f2d6815e8ea27e1af718450250a83f53379b47 /options.c
parentaa7a88a347fda1b709ed18745f832e15441125dd (diff)
downloadltrace-7f40999b3db608961a2ddf59b9c56b611a856611.tar.gz
ltrace-7f40999b3db608961a2ddf59b9c56b611a856611.tar.bz2
ltrace-7f40999b3db608961a2ddf59b9c56b611a856611.zip
Add support for using elfutils as unwinder.
This adds support for using elfutils as unwinder with -w. Since elfutils 0.158 elfutils contains a simple unwinder interface that matches nicely on the ltrace backtrace support. The code reuses the libunwind infrastructure already in ltrace where possible (by defining HAVE_UNWINDER which is 1 if either libunwind or elfutils is used). It also reuses the ltrace proc_add_library callback to keep track of the ELF files mapped for the unwinder. The current implementation matches the output as if libunwind was used. But elfutils can also provide some more information since it can lookup the DWARF debuginfo. So if the source info of an address can be found through elfutils the backtrace will also include this as an additional output line per frame.
Diffstat (limited to 'options.c')
-rw-r--r--options.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/options.c b/options.c
index 8a2fe5d..3d5dfaa 100644
--- a/options.c
+++ b/options.c
@@ -107,9 +107,9 @@ usage(void) {
" -T show the time spent inside each call.\n"
" -u USERNAME run command with the userid, groupid of username.\n"
" -V, --version output version information and exit.\n"
-#if defined(HAVE_LIBUNWIND)
+#if defined(HAVE_UNWINDER)
" -w, --where=NR print backtrace showing NR stack frames at most.\n"
-#endif /* defined(HAVE_LIBUNWIND) */
+#endif /* defined(HAVE_UNWINDER) */
" -x FILTER modify which static functions to trace.\n"
"\nReport bugs to ltrace-devel@lists.alioth.debian.org\n",
progname);
@@ -517,9 +517,9 @@ process_options(int argc, char **argv)
progname = argv[0];
options.output = stderr;
options.no_signals = 0;
-#if defined(HAVE_LIBUNWIND)
+#if defined(HAVE_UNWINDER)
options.bt_depth = -1;
-#endif /* defined(HAVE_LIBUNWIND) */
+#endif /* defined(HAVE_UNWINDER) */
guess_cols();
@@ -543,9 +543,9 @@ process_options(int argc, char **argv)
{"output", 1, 0, 'o'},
{"version", 0, 0, 'V'},
{"no-signals", 0, 0, 'b'},
-# if defined(HAVE_LIBUNWIND)
+# if defined(HAVE_UNWINDER)
{"where", 1, 0, 'w'},
-# endif /* defined(HAVE_LIBUNWIND) */
+# endif /* defined(HAVE_UNWINDER) */
{0, 0, 0, 0}
};
#endif
@@ -554,7 +554,7 @@ process_options(int argc, char **argv)
#ifdef USE_DEMANGLE
"C"
#endif
-#if defined(HAVE_LIBUNWIND)
+#if defined(HAVE_UNWINDER)
"w:"
#endif
"cfhiLrStTVba:A:D:e:F:l:n:o:p:s:u:x:X:";
@@ -679,11 +679,11 @@ process_options(int argc, char **argv)
"There is NO WARRANTY, to the extent permitted by law.\n");
exit(0);
break;
-#if defined(HAVE_LIBUNWIND)
+#if defined(HAVE_UNWINDER)
case 'w':
options.bt_depth = parse_int(optarg, 'w', 1, 0);
break;
-#endif /* defined(HAVE_LIBUNWIND) */
+#endif /* defined(HAVE_UNWINDER) */
case 'x':
parse_filter_chain(optarg, &options.static_filter);