From: Bjorn Munch Date: April 5 2011 9:10am Subject: bzr commit into mysql-5.5-mtr branch (bjorn.munch:3192) Bug#11760361 List-Archive: http://lists.mysql.com/commits/134690 X-Bug: 11760361 Message-Id: <201104050910.p359AKNL024678@khepri15.norway.sun.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1033406204==" --===============1033406204== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline #At file:///home/bm136801/my/dbx-55/ based on revid:bjorn.munch@stripped 3192 Bjorn Munch 2011-04-05 Bug #11760361 52764: EXTEND MYSQL-TEST-RUN SUPPORT FOR SUN STUDIO DBX BY ADDING --DBX DEBUGGER Added necessary options and variables Added dbx_arguments() similar to gdb_arguments() Unlike gdb, cannot use init file but must provide commands and args as command line argument to dbx modified: mysql-test/mysql-test-run.pl === modified file 'mysql-test/mysql-test-run.pl' --- a/mysql-test/mysql-test-run.pl 2011-03-16 14:11:20 +0000 +++ b/mysql-test/mysql-test-run.pl 2011-04-05 09:07:54 +0000 @@ -219,9 +219,12 @@ our %gprof_dirs; our $glob_debugger= 0; our $opt_gdb; our $opt_client_gdb; +our $opt_dbx; +our $opt_client_dbx; our $opt_ddd; our $opt_client_ddd; our $opt_manual_gdb; +our $opt_manual_dbx; our $opt_manual_ddd; our $opt_manual_debug; our $opt_debugger; @@ -1001,6 +1004,9 @@ sub command_line_setup { 'ddd' => \$opt_ddd, 'client-ddd' => \$opt_client_ddd, 'manual-ddd' => \$opt_manual_ddd, + 'dbx' => \$opt_dbx, + 'client-dbx' => \$opt_client_dbx, + 'manual-dbx' => \$opt_manual_dbx, 'debugger=s' => \$opt_debugger, 'client-debugger=s' => \$opt_client_debugger, 'strace-client:s' => \$opt_strace_client, @@ -1426,6 +1432,12 @@ sub command_line_setup { $opt_ddd= undef; } + if ($opt_dbx) { + mtr_warning("Silently converting --dbx to --client-dbx in embedded mode"); + $opt_client_dbx= $opt_dbx; + $opt_dbx= undef; + } + if ($opt_debugger) { mtr_warning("Silently converting --debugger to --client-debugger in embedded mode"); @@ -1434,7 +1446,7 @@ sub command_line_setup { } if ( $opt_gdb || $opt_ddd || $opt_manual_gdb || $opt_manual_ddd || - $opt_manual_debug || $opt_debugger ) + $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"); @@ -1462,6 +1474,7 @@ sub command_line_setup { # -------------------------------------------------------------------------- if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd || $opt_manual_gdb || $opt_manual_ddd || $opt_manual_debug || + $opt_dbx || $opt_client_dbx || $opt_manual_dbx || $opt_debugger || $opt_client_debugger ) { # Indicate that we are using debugger @@ -4704,6 +4717,9 @@ sub mysqld_start ($$) { { ddd_arguments(\$args, \$exe, $mysqld->name()); } + if ( $opt_dbx || $opt_manual_dbx ) { + dbx_arguments(\$args, \$exe, $mysqld->name()); + } elsif ( $opt_debugger ) { debugger_arguments(\$args, \$exe, $mysqld->name()); @@ -5374,6 +5390,9 @@ sub start_mysqltest ($) { { ddd_arguments(\$args, \$exe, "client"); } + if ( $opt_client_dbx ) { + dbx_arguments(\$args, \$exe, "client"); + } elsif ( $opt_client_debugger ) { debugger_arguments(\$args, \$exe, "client"); @@ -5518,6 +5537,53 @@ sub ddd_arguments { # +# Modify the exe and args so that program is run in dbx in xterm +# +sub dbx_arguments { + my $args= shift; + my $exe= shift; + my $type= shift; + + # Write $args to dbx init file + my $str= join " ", @$$args; + my $stop_in; + + if ( $type eq "client" ) { + $stop_in= "main"; + } else { + $stop_in= "mysql_parse"; + } + + if ( $opt_manual_dbx ) { + print "\nTo start dbx for $type, type in another window:\n"; + print "cd $glob_mysql_test_dir; dbx -c \"stop in $stop_in; " . + "run $str; clear\" $$exe\n"; + + # Indicate the exe should not be started + $$exe= undef; + return; + } + + $$args= []; + mtr_add_arg($$args, "-title"); + mtr_add_arg($$args, "$type"); + mtr_add_arg($$args, "-e"); + + if ( $exe_libtool ) { + mtr_add_arg($$args, $exe_libtool); + mtr_add_arg($$args, "--mode=execute"); + } + + mtr_add_arg($$args, "dbx"); + mtr_add_arg($$args, "-c"); + mtr_add_arg($$args, "stop in $stop_in; run $str; clear"); + mtr_add_arg($$args, "$$exe"); + + $$exe= "xterm"; +} + + +# # Modify the exe and args so that program is run in the selected debugger # sub debugger_arguments { @@ -5860,6 +5926,7 @@ Options for debugging the product client-ddd Start mysqltest client in ddd client-debugger=NAME Start mysqltest in the selected debugger client-gdb Start mysqltest client in gdb + client-dbx Start mysqltest client in dbx ddd Start mysqld in ddd debug Dump trace output for all servers and client programs debug-common Same as debug, but sets 'd' debug flags to @@ -5868,12 +5935,15 @@ Options for debugging the product tracing debugger=NAME Start mysqld in the selected debugger gdb Start the mysqld(s) in gdb + dbx Start the mysqld(s) in dbx manual-debug Let user manually start mysqld in debugger, before running test(s) manual-gdb Let user manually start mysqld in gdb, before running test(s) manual-ddd Let user manually start mysqld in ddd, before running test(s) + manual-dbx Let user manually start mysqld in dbx, before running + test(s) strace-client[=path] Create strace output for mysqltest client, optionally specifying name and path to the trace program to use. Example: $0 --strace-client=ktrace --===============1033406204== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/bjorn.munch@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: bjorn.munch@stripped # target_branch: file:///home/bm136801/my/dbx-55/ # testament_sha1: bc5e981a6277411ad77f19f307f2493d8fc2747f # timestamp: 2011-04-05 11:10:20 +0200 # base_revision_id: bjorn.munch@stripped\ # fygq3ceunm9iob3t # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWcE7Z34AA0z/gHl4lABc5/// d6f+7r////5gB06vvd543nFB3K4JdMt2DTWglECZCj0UzTFNkTabUPVPIQ2kaZNAaD1A2oepkNBk gJgQ1BMT1TQA00NGmmgAAAAAGh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