Commit d19fe387 authored by unknown's avatar unknown
Browse files

Delete gdbinit file before writing to it

Concat type+idx to get a unique gdbinit filename

parent 52c4dbd8
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -2550,11 +2550,11 @@ sub mysqld_start ($$$$$) {

  if ( $opt_gdb || $opt_manual_gdb)
  {
    gdb_arguments(\$args, \$exe, $type);
    gdb_arguments(\$args, \$exe, "$type"."_$idx");
  }
  elsif ( $opt_ddd || $opt_manual_ddd )
  {
    ddd_arguments(\$args, \$exe, $type);
    ddd_arguments(\$args, \$exe, "$type"."_$idx");
  }
  elsif ( $opt_manual_debug )
  {
@@ -3089,6 +3089,9 @@ sub gdb_arguments {
  my $str= join(" ", @$$args);
  my $gdb_init_file= "$opt_tmpdir/gdbinit.$type";

  # Remove the old gdbinit file
  unlink($gdb_init_file);

  if ( $type eq "client" )
  {
    # write init file for client
@@ -3150,6 +3153,9 @@ sub ddd_arguments {
  my $str= join(" ", @$$args);
  my $gdb_init_file= "$opt_tmpdir/gdbinit.$type";

  # Remove the old gdbinit file
  unlink($gdb_init_file);

  if ( $type eq "client" )
  {
    # write init file for client