diff options
author | Adrian Prantl <aprantl@apple.com> | 2013-09-06 18:12:01 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2013-09-06 18:12:01 +0000 |
commit | 4f1e5fba415d422543ee820ac68c1020b0c11187 (patch) | |
tree | 3f8301643579b0fdb87b5de74795118557c99805 /utils | |
parent | fb386db636d134b0b72cf0a37075906cf8f7248c (diff) | |
download | external_llvm-4f1e5fba415d422543ee820ac68c1020b0c11187.zip external_llvm-4f1e5fba415d422543ee820ac68c1020b0c11187.tar.gz external_llvm-4f1e5fba415d422543ee820ac68c1020b0c11187.tar.bz2 |
debuginfo-tests: Add support for an lldb wrapper script
to be used on darwin in lieu of gdb.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190186 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/test_debuginfo.pl | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/utils/test_debuginfo.pl b/utils/test_debuginfo.pl index 0832a33..a6b6137 100755 --- a/utils/test_debuginfo.pl +++ b/utils/test_debuginfo.pl @@ -11,8 +11,13 @@ # and run the script generated from source program comments. Finally, # the debugger output is checked, using FileCheck, to validate # debugging information. +# +# On Darwin the default is to use the llgdb.py wrapper script which +# translates gdb commands into their lldb equivalents. use File::Basename; +use Config; +use Cwd; my $testcase_file = $ARGV[0]; my $executable_file = $ARGV[1]; @@ -23,6 +28,11 @@ my $output_dir = dirname $executable_file; my $debugger_script_file = "$output_dir/$input_filename.debugger.script"; my $output_file = "$output_dir/$input_filename.gdb.output"; +my %cmd_map = (); +# Assume lldb to be the debugger on Darwin. +my $use_lldb = 0; +$use_lldb = 1 if ($Config{osname} eq "darwin"); + # Extract debugger commands from testcase. They are marked with DEBUGGER: # at the beginning of a comment line. open(INPUT, $testcase_file); @@ -44,8 +54,15 @@ close(OUTPUT); # setup debugger and debugger options to run a script. my $my_debugger = $ENV{'DEBUGGER'}; if (!$my_debugger) { - $my_debugger = "gdb"; + if ($use_lldb) { + my $path = dirname(Cwd::abs_path($0)); + $my_debugger = "/usr/bin/env python $path/../tools/clang/test/debuginfo-tests/llgdb.py"; + } else { + $my_debugger = "gdb"; + } } + +# quiet / exit after cmdline / no init file / execute script my $debugger_options = "-q -batch -n -x"; # run debugger and capture output. |