View | Details | Raw Unified | Return to bug 27133
Collapse All | Expand All

(-)a/gdb/cli/cli-interp.c (+8 lines)
Lines 430-435 cli_interp_base::set_logging (ui_file_up logfile, bool logging_redirect, Link Here
430
	  saved_output.file_to_delete = tee;
430
	  saved_output.file_to_delete = tee;
431
	}
431
	}
432
432
433
      /* Make sure that the call to logfile's dtor does not delete the
434
         underlying pointer if we still keep a reference to it.  If
435
         logfile_p is not referenced as the file_to_delete, then either
436
         the logfile is not used (no redirection) and it should be
437
         deleted, or a tee took ownership of the pointer. */
438
      if (logfile_p != nullptr && saved_output.file_to_delete == logfile_p)
439
	logfile.release ();
440
433
      gdb_stdout = logging_redirect ? logfile_p : tee;
441
      gdb_stdout = logging_redirect ? logfile_p : tee;
434
      gdb_stdlog = debug_redirect ? logfile_p : tee;
442
      gdb_stdlog = debug_redirect ? logfile_p : tee;
435
      gdb_stderr = logging_redirect ? logfile_p : tee;
443
      gdb_stderr = logging_redirect ? logfile_p : tee;
(-)a/gdb/testsuite/gdb.base/ui-redirect.exp (-1 / +8 lines)
Lines 140-142 with_test_prefix "redirect debugging" { Link Here
140
    gdb_test "set logging off" "Done logging to /dev/null\\."
140
    gdb_test "set logging off" "Done logging to /dev/null\\."
141
    gdb_test "help" "List of classes of commands:.*"
141
    gdb_test "help" "List of classes of commands:.*"
142
}
142
}
143
- 
143
144
with_test_prefix "redirect logging and debuging" {
145
    gdb_test_no_output "set logging redirect on"
146
    gdb_test_no_output "set logging debugredirect on"
147
    gdb_test "set logging on" \
148
    "Redirecting output to /dev/null.*Redirecting debug output to /dev/null\\."
149
    gdb_test "set logging off" "Done logging to /dev/null\\."
150
}

Return to bug 27133