Eliminate interp::quiet_p
authorPedro Alves <palves@redhat.com>
Wed, 8 Feb 2017 18:08:18 +0000 (18:08 +0000)
committerPedro Alves <palves@redhat.com>
Wed, 8 Feb 2017 18:08:18 +0000 (18:08 +0000)
commita474bd8eeea16b2b6aa7089dedb142d86c22a4d7
tree3953113c2b500dd0d8b1db8414a8a478c7e7b472
parent604c4576fdcfc4e7c28f569b3748a1b6b4e0dbd4
Eliminate interp::quiet_p

This commit removes interp::quiet_p / interp_quiet_p /
interp_set_quiet, because AFAICS, it doesn't really do anything.

interp_quiet is only ever checked inside interp_set nowadays:

  if (!first_time && !interp_quiet_p (interp))
    {
      xsnprintf (buffer, sizeof (buffer),
 "Switching to interpreter \"%.24s\".\n", interp->name);
      current_uiout->text (buffer);
    }

I did a bit of archaelogy, and found that back in 4a8f6654 (2003), it
was also called in another place, to decide whether to print the CLI
prompt.

AFAICS, that condition is always false today, making that if/then
block always dead code.  If we remove that code, then there are no
interp_quiet_p uses left in the tree, so we can remove it all.

There are two paths that lead to interp_set calls:

#1 - When installing the top level interpreter.  In this case,
FIRST_TIME is true.

#2 - In interpreter_exec_cmd.  In this case, the interpreter is always
set quiet before interp_set is called.

Grepping a gdb.log of an x86_64 GNU/Linux run for "Switching to
interpreter" (before this patch) doesn't find any hits.

I suspect the intention of this message was to support something like
a "set interpreter ..." command that would change the interpreter
permanently.  But there's no such command.

Tested on x86_64 Fedora 23.

gdb/ChangeLog:
2017-02-08  Pedro Alves  <palves@redhat.com>

* interps.c (interp::interp): Remove reference to quiet_p.
(interp_set): Make static.  Remove dead "Switching to" output
code.
(interp_quiet_p, interp_set_quiet): Delete.
(interpreter_exec_cmd): Don't set the interpreter quiet.
* interps.h (interp_quiet_p): Make static.
(class interp) <quiet_p>: Remove field
gdb/ChangeLog
gdb/interps.c
gdb/interps.h
This page took 0.025677 seconds and 4 git commands to generate.