summaryrefslogtreecommitdiffstats
path: root/matrace.in
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-09-20 18:52:27 +0200
committerLennart Poettering <lennart@poettering.net>2009-09-20 18:52:27 +0200
commit2c534d50ae0d9d7ba0619ff8af90d4d269175ea3 (patch)
treee460d731f5972f37682f7d7b0b3c7aee4b4879ee /matrace.in
parent3cea0fbd9256a9612b0e17b53635242eb05e8ffe (diff)
optionally read debug info for backtraces
Diffstat (limited to 'matrace.in')
-rwxr-xr-xmatrace.in14
1 files changed, 13 insertions, 1 deletions
diff --git a/matrace.in b/matrace.in
index 7d4d8c6..7ab078f 100755
--- a/matrace.in
+++ b/matrace.in
@@ -17,12 +17,14 @@
# You should have received a copy of the GNU Lesser General Public
# License along with mutrace. If not, see <http://www.gnu.org/licenses/>.
-if ! TEMP=`getopt -o +h --long frames:,help -n matrace -- "$@"` ; then
+if ! TEMP=`getopt -o +dh --long frames:,debug-info,help -n matrace -- "$@"` ; then
exit 1
fi
eval set -- "$TEMP"
+debug_info=0
+
while : ; do
case $1 in
--frames)
@@ -30,6 +32,11 @@ while : ; do
shift 2
;;
+ -d|--debug-info)
+ debug_info=1
+ shift 1
+ ;;
+
-h|--help)
cat <<EOF
@PACKAGE_STRING@
@@ -41,6 +48,7 @@ COMMANDS:
OPTIONS:
--frames=INTEGER Set number of frames to show in stack traces
+ -d, --debug-info Make use of debug information in stack traces
EOF
exit 0
;;
@@ -69,4 +77,8 @@ else
export LD_PRELOAD="$LD_PRELOAD libmatrace.so"
fi
+if [ x"$debug_info" = x1 ] ; then
+ export LD_PRELOAD="$LD_PRELOAD:libmutrace-backtrace-symbols.so"
+fi
+
exec "$@"