From: Bjorn Munch Date: April 7 2011 8:11am Subject: bzr commit into mysql-5.5-mtr branch (bjorn.munch:3194) Bug#11760361 List-Archive: http://lists.mysql.com/commits/134893 X-Bug: 11760361 Message-Id: <201104070811.p378BYKv000419@khepri15.norway.sun.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0295797625==" --===============0295797625== 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 3194 Bjorn Munch 2011-04-07 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 Also simplified debugger behavior to always start with a breakpoint in main() 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-07 08:10:57 +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"); @@ -5408,23 +5427,11 @@ sub gdb_arguments { # Remove the old gdbinit file unlink($gdb_init_file); - if ( $type eq "client" ) - { - # write init file for client - mtr_tofile($gdb_init_file, - "set args $str\n" . - "break main\n"); - } - else - { - # write init file for mysqld - mtr_tofile($gdb_init_file, - "set args $str\n" . - "break mysql_parse\n" . - "commands 1\n" . - "disable 1\n" . - "end\n"); - } + # write init file for mysqld or client + mtr_tofile($gdb_init_file, + "set args $str\n" . + "break main\n" . + "run"); if ( $opt_manual_gdb ) { @@ -5471,24 +5478,12 @@ sub ddd_arguments { # Remove the old gdbinit file unlink($gdb_init_file); - if ( $type eq "client" ) - { - # write init file for client - mtr_tofile($gdb_init_file, - "set args $str\n" . - "break main\n"); - } - else - { - # write init file for mysqld - mtr_tofile($gdb_init_file, - "file $$exe\n" . - "set args $str\n" . - "break mysql_parse\n" . - "commands 1\n" . - "disable 1\n" . - "end"); - } + # write init file for mysqld or client + mtr_tofile($gdb_init_file, + "file $$exe\n" . + "set args $str\n" . + "break main\n" . + "run"); if ( $opt_manual_ddd ) { @@ -5518,6 +5513,46 @@ 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; + + # Put $args into a single string + my $str= join " ", @$$args; + + 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 main; " . + "run $str\" $$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 main; run $str"); + mtr_add_arg($$args, "$$exe"); + + $$exe= "xterm"; +} + + +# # Modify the exe and args so that program is run in the selected debugger # sub debugger_arguments { @@ -5548,18 +5583,6 @@ sub debugger_arguments { $$exe= $debugger; } - elsif ( $debugger eq "dbx" ) - { - # xterm -e dbx -r exe arg1 .. argn - - unshift(@$$args, $$exe); - unshift(@$$args, "-r"); - unshift(@$$args, $debugger); - unshift(@$$args, "-e"); - - $$exe= "xterm"; - - } else { mtr_error("Unknown argument \"$debugger\" passed to --debugger"); @@ -5860,6 +5883,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 +5892,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 --===============0295797625== 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: 2ad8dd81c7b85ee2665b1a98a97628654c90e7f6 # timestamp: 2011-04-07 10:11:33 +0200 # base_revision_id: bjorn.munch@stripped\ # 63b3fni4wimua3od # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWQ9PZ4sAA5L/gHl4lABc5/// d6f+br////5gB9zvs7vPedtc6C7zxWO84DkHVsCGkFT2qeRPUAaD1NBpo9QA0A9Q2kD1D1PKHqbU AaEJkwTIJqelHlA0NDIaNAGgAAAABoEyIRT9J6k08KZMmjymjxQyBkaGQDIZMgGEiJBok1T2TJGN JieU9KeoyMh6TINBgmgaYCbQ5o0aGmEA0wJpoAyGhiANGI0MEZABIpNAAIIxBqPQaU/U0xBlM0mT TQaDQAGTVuJCqIe+aWNs4Oo1jadurba54eq4uGdf4Fnp5vIPcw8vUbcYGh2ZrvRfdogt9ri0ejBE P3GMYNFPV0VKvZct185gigyJF0aJIsrcE9MaiaZuGnak5YW1wAQJ0jlQNGA/EQcEheRh/E/hOlhw DU1S1M+E03xOy/lcbPfEYzBLIzZb3yFJ9KN/Qe1+Ln0TnS5+RibSNz1paaYvmIjWz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lpBXkZJMpRbaL/kmly/NAP/F3JFOFCQD09niw --===============0295797625==--