[2/6] gdb, cli: remove left-over code from "set_logging_on".

Message ID 20231229104202.7878-3-natalia.saiapova@intel.com
State New
Headers
Series Refinement of scheduler-locking settings |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed

Commit Message

Natalia Saiapova Dec. 29, 2023, 10:41 a.m. UTC
  This is a refactoring.  Remove the left-over code, which rewrites
the logging filename in "set logging on" command.

The code became unused after the deprecation of "set logging (on|off)"
command.  Before the deprecation, the command could also take a file
name and rewrite the logging file, e.g.:
  (gdb) set logging on lalala
  Copying output to lalala.
  Copying debug output to lalala.

After the command was deprecated and reimplemented as an alias to "set
logging enable on", additional input after "on" became invalid:

  (gdb) set logging on lalala
  Warning: 'set logging on', an alias for the command 'set logging enabled', is deprecated.
  Use 'set logging enabled on'.

  "on" or "off" expected.
  (gdb) set logging on lalala
  "on" or "off" expected.
  (gdb) set logging enable on lalala
  "on" or "off" expected.
  (gdb) set logging enable on
  Copying output to gdb.txt.
  Copying debug output to gdb.txt.
---
 gdb/cli/cli-logging.c | 5 -----
 1 file changed, 5 deletions(-)
  

Comments

Tom Tromey Feb. 8, 2024, 6:50 p.m. UTC | #1
>>>>> "Natalia" == Natalia Saiapova <natalia.saiapova@intel.com> writes:

Natalia> This is a refactoring.  Remove the left-over code, which rewrites
Natalia> the logging filename in "set logging on" command.

Thank you.  This is ok.
Approved-By: Tom Tromey <tom@tromey.com>

Tom
  

Patch

diff --git a/gdb/cli/cli-logging.c b/gdb/cli/cli-logging.c
index a74e43034e8..e2ce0262538 100644
--- a/gdb/cli/cli-logging.c
+++ b/gdb/cli/cli-logging.c
@@ -160,11 +160,6 @@  handle_redirections (int from_tty)
 static void
 set_logging_on (const char *args, int from_tty)
 {
-  const char *rest = args;
-
-  if (rest && *rest)
-    logging_filename = rest;
-
   handle_redirections (from_tty);
 }