diff options
author | Sayantan Dutta <sayantan.dutta@oracle.com> | 2014-09-02 15:12:55 +0530 |
---|---|---|
committer | Sayantan Dutta <sayantan.dutta@oracle.com> | 2014-09-02 15:12:55 +0530 |
commit | 9fb7de7b650fddd6bd02d9a4aaa8fe31c18a84a7 (patch) | |
tree | ffe0a74b847d852f6f918e01a5573bb06f1aec52 /mysql-test/mysql-test-run.pl | |
parent | a79758702933059400919b8e95525429f44d8a1c (diff) | |
download | mariadb-git-9fb7de7b650fddd6bd02d9a4aaa8fe31c18a84a7.tar.gz |
Bug #19361402 - ADD --MANUAL-LLDB OPTION TO MYSQL-TEST-RUN.PL, contributed
Diffstat (limited to 'mysql-test/mysql-test-run.pl')
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index e236d3ce267..636f3d88c62 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -232,6 +232,7 @@ our $opt_ddd; our $opt_client_ddd; my $opt_boot_ddd; our $opt_manual_gdb; +our $opt_manual_lldb; our $opt_manual_dbx; our $opt_manual_ddd; our $opt_manual_debug; @@ -1086,6 +1087,7 @@ sub command_line_setup { 'gdb' => \$opt_gdb, 'client-gdb' => \$opt_client_gdb, 'manual-gdb' => \$opt_manual_gdb, + 'manual-lldb' => \$opt_manual_lldb, 'boot-gdb' => \$opt_boot_gdb, 'manual-debug' => \$opt_manual_debug, 'ddd' => \$opt_ddd, @@ -1536,8 +1538,9 @@ sub command_line_setup { $opt_debugger= undef; } - if ( $opt_gdb || $opt_ddd || $opt_manual_gdb || $opt_manual_ddd || - $opt_manual_debug || $opt_debugger || $opt_dbx || $opt_manual_dbx) + if ( $opt_gdb || $opt_ddd || $opt_manual_gdb || $opt_manual_lldb || + $opt_manual_ddd || $opt_manual_debug || $opt_debugger || $opt_dbx || + $opt_manual_dbx) { mtr_error("You need to use the client debug options for the", "embedded server. Ex: --client-gdb"); @@ -1564,7 +1567,7 @@ sub command_line_setup { # Check debug related options # -------------------------------------------------------------------------- if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd || - $opt_manual_gdb || $opt_manual_ddd || $opt_manual_debug || + $opt_manual_gdb || $opt_manual_gdb || $opt_manual_ddd || $opt_manual_debug || $opt_dbx || $opt_client_dbx || $opt_manual_dbx || $opt_debugger || $opt_client_debugger ) { @@ -4985,6 +4988,10 @@ sub mysqld_start ($$) { { gdb_arguments(\$args, \$exe, $mysqld->name()); } + elsif ( $opt_manual_lldb ) + { + lldb_arguments(\$args, \$exe, $mysqld->name()); + } elsif ( $opt_ddd || $opt_manual_ddd ) { ddd_arguments(\$args, \$exe, $mysqld->name()); @@ -5730,6 +5737,33 @@ sub gdb_arguments { $$exe= "xterm"; } + # +# Modify the exe and args so that program is run in lldb +# +sub lldb_arguments { + my $args= shift; + my $exe= shift; + my $type= shift; + my $input= shift; + + my $lldb_init_file= "$opt_vardir/tmp/lldbinit.$type"; + unlink($lldb_init_file); + + my $str= join(" ", @$$args); + my $runline= $input ? "r $str < $input" : "r $str"; + + # write init file for mysqld or client + mtr_tofile($lldb_init_file, + "b main\n" . + $runline); + + print "\nTo start lldb for $type, type in another window:\n"; + print "cd $glob_mysql_test_dir && lldb -s $lldb_init_file $$exe\n"; + + # Indicate the exe should not be started + $$exe= undef; + return; +} # # Modify the exe and args so that program is run in ddd @@ -6190,6 +6224,8 @@ Options for debugging the product test(s) manual-dbx Let user manually start mysqld in dbx, before running test(s) + manual-lldb Let user manually start mysqld in lldb, before running + test(s) strace-client Create strace output for mysqltest client, strace-server Create strace output for mysqltest server, max-save-core Limit the number of core files saved (to avoid filling |