This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Redundancy in remote.c packet config messages?


While working on a recently posted patch to eliminate
deprecated_show_value_hack() from remote.c, I began to wonder if
there's some redundancy in the messages showing the state of the
machinery used for enabling and disabling the various remote protocol
packets.

Consider "show remote p-packet":

    (gdb) show remote p-packet
    Current use of remote protocol `p' (fetch-register) is auto.
    Support for remote protocol `p' (fetch-register) packet is auto-detected,
    currently unknown.

The first line (beginning with "Current") says that the value of the
p-packet "auto boolean" variable is auto.  The second and (subsequent)
line says the same thing as well as providing the detection status.
If you examine the code involved, the "auto" in the first line and the
"auto-detected" in the second line were both determined by examining
the same variable.  (Though you do have to wade through a bit of code
to figure this out.)

If I'm not mistaken, we have a similar situation when the packet has
been enabled and disabled by the user:

    (gdb) set remote p-packet on
    (gdb) show remote p-packet
    Current use of remote protocol `p' (fetch-register) is on.
    Support for remote protocol `p' (fetch-register) packet is currently
    enabled.
    (gdb) set remote p-packet off
    (gdb) show remote p-packet
    Current use of remote protocol `p' (fetch-register) is off.
    Support for remote protocol `p' (fetch-register) packet is currently
    disabled.

Does anyone know of a case where the first line provides non-redundant
information?  If not, I'd like to prepare a patch which eliminates it. 
That is, I would like the above session to instead show the following
output:

    (gdb) show remote p-packet
    Support for remote protocol `p' (fetch-register) packet is auto-detected,
    currently unknown.

    (gdb) set remote p-packet on
    (gdb) show remote p-packet
    Support for remote protocol `p' (fetch-register) packet is currently
    enabled.
    (gdb) set remote p-packet off
    (gdb) show remote p-packet
    Support for remote protocol `p' (fetch-register) packet is currently
    disabled.

Kevin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]