Commit 9fb7de7b authored by Sayantan Dutta's avatar Sayantan Dutta

Bug #19361402 - ADD --MANUAL-LLDB OPTION TO MYSQL-TEST-RUN.PL, contributed

parent a7975870
...@@ -232,6 +232,7 @@ our $opt_ddd; ...@@ -232,6 +232,7 @@ our $opt_ddd;
our $opt_client_ddd; our $opt_client_ddd;
my $opt_boot_ddd; my $opt_boot_ddd;
our $opt_manual_gdb; our $opt_manual_gdb;
our $opt_manual_lldb;
our $opt_manual_dbx; our $opt_manual_dbx;
our $opt_manual_ddd; our $opt_manual_ddd;
our $opt_manual_debug; our $opt_manual_debug;
...@@ -1086,6 +1087,7 @@ sub command_line_setup { ...@@ -1086,6 +1087,7 @@ sub command_line_setup {
'gdb' => \$opt_gdb, 'gdb' => \$opt_gdb,
'client-gdb' => \$opt_client_gdb, 'client-gdb' => \$opt_client_gdb,
'manual-gdb' => \$opt_manual_gdb, 'manual-gdb' => \$opt_manual_gdb,
'manual-lldb' => \$opt_manual_lldb,
'boot-gdb' => \$opt_boot_gdb, 'boot-gdb' => \$opt_boot_gdb,
'manual-debug' => \$opt_manual_debug, 'manual-debug' => \$opt_manual_debug,
'ddd' => \$opt_ddd, 'ddd' => \$opt_ddd,
...@@ -1536,8 +1538,9 @@ sub command_line_setup { ...@@ -1536,8 +1538,9 @@ sub command_line_setup {
$opt_debugger= undef; $opt_debugger= undef;
} }
if ( $opt_gdb || $opt_ddd || $opt_manual_gdb || $opt_manual_ddd || if ( $opt_gdb || $opt_ddd || $opt_manual_gdb || $opt_manual_lldb ||
$opt_manual_debug || $opt_debugger || $opt_dbx || $opt_manual_dbx) $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", mtr_error("You need to use the client debug options for the",
"embedded server. Ex: --client-gdb"); "embedded server. Ex: --client-gdb");
...@@ -1564,7 +1567,7 @@ sub command_line_setup { ...@@ -1564,7 +1567,7 @@ sub command_line_setup {
# Check debug related options # Check debug related options
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd || 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_dbx || $opt_client_dbx || $opt_manual_dbx ||
$opt_debugger || $opt_client_debugger ) $opt_debugger || $opt_client_debugger )
{ {
...@@ -4985,6 +4988,10 @@ sub mysqld_start ($$) { ...@@ -4985,6 +4988,10 @@ sub mysqld_start ($$) {
{ {
gdb_arguments(\$args, \$exe, $mysqld->name()); gdb_arguments(\$args, \$exe, $mysqld->name());
} }
elsif ( $opt_manual_lldb )
{
lldb_arguments(\$args, \$exe, $mysqld->name());
}
elsif ( $opt_ddd || $opt_manual_ddd ) elsif ( $opt_ddd || $opt_manual_ddd )
{ {
ddd_arguments(\$args, \$exe, $mysqld->name()); ddd_arguments(\$args, \$exe, $mysqld->name());
...@@ -5730,6 +5737,33 @@ sub gdb_arguments { ...@@ -5730,6 +5737,33 @@ sub gdb_arguments {
$$exe= "xterm"; $$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 # Modify the exe and args so that program is run in ddd
...@@ -6190,6 +6224,8 @@ Options for debugging the product ...@@ -6190,6 +6224,8 @@ Options for debugging the product
test(s) test(s)
manual-dbx Let user manually start mysqld in dbx, before running manual-dbx Let user manually start mysqld in dbx, before running
test(s) test(s)
manual-lldb Let user manually start mysqld in lldb, before running
test(s)
strace-client Create strace output for mysqltest client, strace-client Create strace output for mysqltest client,
strace-server Create strace output for mysqltest server, strace-server Create strace output for mysqltest server,
max-save-core Limit the number of core files saved (to avoid filling max-save-core Limit the number of core files saved (to avoid filling
......
File mode changed from 100644 to 100755
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment