aboutsummaryrefslogtreecommitdiffstats
path: root/test/run_and_catch_crashes
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-05-11 13:29:08 -0700
committerGuy Harris <guy@alum.mit.edu>2015-05-11 20:29:34 +0000
commitf1c375d0068eb79fd42024bf4e6f4216e13881cf (patch)
tree51e965c14d202d68edca1148ef8ac5da76120e6a /test/run_and_catch_crashes
parent1fa0e72d53d23b041ab6b7a927f9b87319b16a9a (diff)
Try to handle the executable being a libtool wrapper.
Change-Id: I8fd2b4445707029ea24ad3c02804c0bf8fcedd15 Reviewed-on: https://code.wireshark.org/review/8406 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'test/run_and_catch_crashes')
-rwxr-xr-xtest/run_and_catch_crashes31
1 files changed, 29 insertions, 2 deletions
diff --git a/test/run_and_catch_crashes b/test/run_and_catch_crashes
index 28411c2242..282d131df2 100755
--- a/test/run_and_catch_crashes
+++ b/test/run_and_catch_crashes
@@ -51,6 +51,17 @@ then
then
#
# Found the executable.
+ # Is it a libtool wrapper script? Look for a .libs
+ # directory.
+ #
+ executable_dirname=`dirname "$executable"`
+ if [ -d "$executable_dirname"/.libs ]
+ then
+ is_libtool_wrapper=yes
+ else
+ is_libtool_wrapper=no
+ fi
+
#
# Now, look for a debugger.
# XXX - lldb?
@@ -63,10 +74,18 @@ then
# cause the stack trace to go to the standard
# error.
#
- dbx "$executable" core 1>&2 <<EOF
+ if [ $is_libtool_wrapper = yes ]
+ then
+ $executable_dirname/libtool --mode=execute dbx "$executable" core 1>&2 <<EOF
where
quit
EOF
+ else
+ dbx "$executable" core 1>&2 <<EOF
+where
+quit
+EOF
+ fi
else
gdb=`which gdb`
if [ ! -z "$gdb" ]
@@ -76,10 +95,18 @@ EOF
# cause the stack trace to go to the standard
# error.
#
- gdb "$executable" core 1>&2 <<EOF
+ if [ $is_libtool_wrapper = yes ]
+ then
+ $executable_dirname/libtool --mode=execute gdb "$executable" core 1>&2 <<EOF
+backtrace
+quit
+EOF
+ else
+ gdb "$executable" core 1>&2 <<EOF
backtrace
quit
EOF
+ fi
fi
fi
fi