Skip to content

Commit

Permalink
Detect which debugger to use in t-gdb scripts: lldb or gdb
Browse files Browse the repository at this point in the history
Should make debugging on Mac and BSD less painful.
  • Loading branch information
qris committed Dec 21, 2016
1 parent e5b6e22 commit da98a81
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion infrastructure/m4/boxbackup_tests.m4
Original file line number Diff line number Diff line change
Expand Up @@ -369,4 +369,10 @@ fi
;;
esac


AC_CHECK_PROGS(default_debugger, [lldb gdb])
AC_ARG_WITH([debugger],
[AS_HELP_STRING([--with-debugger=<gdb|lldb|...>],
[use this debugger in t-gdb scripts to debug tests @<:@default=lldb if present, otherwise gdb@:>@])],
[],
[with_debugger=$default_debugger])
AC_SUBST([with_debugger])
3 changes: 2 additions & 1 deletion infrastructure/makebuildenv.pl.in
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ $default_cflags =~ s/ -O2//g;
$default_cxxflags =~ s/ -O2//g;
my $debug_base_dir = 'debug';
my $release_base_dir = 'release';
my $debugger = '@with_debugger@';

my $release_flags = "-O2";
if ($target_windows)
Expand Down Expand Up @@ -615,7 +616,7 @@ __E
writetestfile("$mod/t", "GLIBCXX_FORCE_NEW=1 ".
'./_test' . $platform_exe_ext . ' "$@"', $mod);
writetestfile("$mod/t-gdb", "GLIBCXX_FORCE_NEW=1 ".
'gdb ./_test' . $platform_exe_ext . ' "$@"', $mod);
$debugger . ' ./_test' . $platform_exe_ext . ' "$@"', $mod);

}

Expand Down

0 comments on commit da98a81

Please sign in to comment.