[OBVIOUS] enable frame-filter short help uses disable instead of enable

Message ID 20180917222334.27753-1-philippe.waroquiers@skynet.be
State New, archived
Headers

Commit Message

Philippe Waroquiers Sept. 17, 2018, 10:23 p.m. UTC
  Without the patch:
  (gdb) apropos able frame-filter
  disable frame-filter -- GDB command to disable the specified frame-filter
  enable frame-filter -- GDB command to disable the specified frame-filter

With the patch:
  (gdb) apropos able frame-filter
  disable frame-filter -- GDB command to disable the specified frame-filter
  enable frame-filter -- GDB command to enable the specified frame-filter

Pushed as obvious
---
 gdb/python/lib/gdb/command/frame_filters.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Philippe Waroquiers Sept. 17, 2018, 10:41 p.m. UTC | #1
Note that the Usage: string in the below still looks strange to me:
the second 'enable' in
     Usage: enable frame-filter enable DICTIONARY [NAME]
should be removed (and similarly in the disable frame-filter).

Then, reading the 'help enable frame-filter', it looks like DICTIONARY is
optional, but the Usage: seems to indicate it is mandatory.

I am wondering if the correct Usage: would be something like:
    Usage: enable frame-filter enable [DICTIONARY [NAME]]
(and similar for disable frame-filter).

The texinfo documentation seems also somewhat different
from the 'help enable frame-filter' e.g. it tells that DICTIONARY may be
the name of an object file, while the help does not tell that (at least
not that clearly).

So, would be good if someone mastering frame filter would clarify
the doc/help.

Philippe

 
On Tue, 2018-09-18 at 00:23 +0200, Philippe Waroquiers wrote:
> Without the patch:
>   (gdb) apropos able frame-filter
>   disable frame-filter -- GDB command to disable the specified frame-filter
>   enable frame-filter -- GDB command to disable the specified frame-filter
> 
> With the patch:
>   (gdb) apropos able frame-filter
>   disable frame-filter -- GDB command to disable the specified frame-filter
>   enable frame-filter -- GDB command to enable the specified frame-filter
> 
> Pushed as obvious
> ---
>  gdb/python/lib/gdb/command/frame_filters.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdb/python/lib/gdb/command/frame_filters.py b/gdb/python/lib/gdb/command/frame_filters.py
> index 3afe5e9ac1..16a40ed98e 100644
> --- a/gdb/python/lib/gdb/command/frame_filters.py
> +++ b/gdb/python/lib/gdb/command/frame_filters.py
> @@ -207,7 +207,7 @@ def _complete_frame_filter_name(word, printer_dict):
>      return flist
>  
>  class EnableFrameFilter(gdb.Command):
> -    """GDB command to disable the specified frame-filter.
> +    """GDB command to enable the specified frame-filter.
>  
>      Usage: enable frame-filter enable DICTIONARY [NAME]
>
  
Tom Tromey Sept. 18, 2018, 4:35 a.m. UTC | #2
>>>>> "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:

Philippe> Note that the Usage: string in the below still looks strange to me:
Philippe> the second 'enable' in
Philippe>      Usage: enable frame-filter enable DICTIONARY [NAME]
Philippe> should be removed (and similarly in the disable frame-filter).

Yes, I agree.

Philippe> Then, reading the 'help enable frame-filter', it looks like DICTIONARY is
Philippe> optional, but the Usage: seems to indicate it is mandatory.

Looking at the code it seems like the syntax is:

    enable frame-filter [all | DICTIONARY NAME]

Though there is a bug if you don't pass arguments at all:

    (gdb)  enable frame-filter 
    Traceback (most recent call last):
      File "/usr/share/gdb/python/gdb/command/frame_filters.py", line 238, in invoke
        command_tuple = _enable_parse_arg("enable frame-filter", arg)
      File "/usr/share/gdb/python/gdb/command/frame_filters.py", line 115, in _enable_parse_arg
        if argv[0] == "all" and argc > 1:
    IndexError: list index out of range
    Error occurred in Python command: list index out of range

Tom
  

Patch

diff --git a/gdb/python/lib/gdb/command/frame_filters.py b/gdb/python/lib/gdb/command/frame_filters.py
index 3afe5e9ac1..16a40ed98e 100644
--- a/gdb/python/lib/gdb/command/frame_filters.py
+++ b/gdb/python/lib/gdb/command/frame_filters.py
@@ -207,7 +207,7 @@  def _complete_frame_filter_name(word, printer_dict):
     return flist
 
 class EnableFrameFilter(gdb.Command):
-    """GDB command to disable the specified frame-filter.
+    """GDB command to enable the specified frame-filter.
 
     Usage: enable frame-filter enable DICTIONARY [NAME]