Commit e95e8764 authored by Sayantan Dutta's avatar Sayantan Dutta

Bug #19361317 - --MANUAL-GDB EFFECTIVELY TRUNCATES OPTION FILE ARGS AT FIRST SEMICOLON

parent 9fb7de7b
......@@ -5684,6 +5684,24 @@ sub start_mysqltest ($) {
return $proc;
}
sub create_debug_statement {
my $args= shift;
my $input= shift;
# Put $args into a single string
my $str= join(" ", @$$args);
my $runline= $input ? "run $str < $input" : "run $str";
# add quotes to escape ; in plugin_load option
my $pos1 = index($runline, "--plugin_load=");
if ( $pos1 != -1 ) {
my $pos2 = index($runline, " ",$pos1);
substr($runline,$pos1+14,0) = "\"";
substr($runline,$pos2+1,0) = "\"";
}
return $runline;
}
#
# Modify the exe and args so that program is run in gdb in xterm
......@@ -5699,9 +5717,7 @@ sub gdb_arguments {
# Remove the old gdbinit file
unlink($gdb_init_file);
# Put $args into a single string
my $str= join(" ", @$$args);
my $runline= $input ? "run $str < $input" : "run $str";
my $runline=create_debug_statement($args,$input);
# write init file for mysqld or client
mtr_tofile($gdb_init_file,
......@@ -5749,8 +5765,7 @@ sub lldb_arguments {
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";
my $runline=create_debug_statement($args,$input);
# write init file for mysqld or client
mtr_tofile($lldb_init_file,
......@@ -5779,9 +5794,7 @@ sub ddd_arguments {
# Remove the old gdbinit file
unlink($gdb_init_file);
# Put $args into a single string
my $str= join(" ", @$$args);
my $runline= $input ? "run $str < $input" : "run $str";
my $runline=create_debug_statement($args,$input);
# write init file for mysqld or client
mtr_tofile($gdb_init_file,
......
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