Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] use filename_completer for add_setshow_optional_filename_cmd
@ 2008-07-01 21:38 Pierre Muller
  2008-07-01 22:03 ` Pedro Alves
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Pierre Muller @ 2008-07-01 21:38 UTC (permalink / raw)
  To: gdb-patches


  I discovered that
set debug-file-directory does not use filename_completer.

  This is because add_setshow_optional_filename_cmd
does not set the set completer to filename completer,
contrary to add_setshow_filename_cmd.
  
  Is there any reason for this?
Or is it just a bug?

  The following small patch fixes this
by setting the set part completer to filename_completer
for  add_setshow_optional_filename_cmd
exactly as is done in add_setshow_filename_cmd.
  
  There are currently only three adffected commands:

"set debug-file-directory"
"set args"
"set solib-search-path"

  Only the second one might be questionable,
but I also find that it is reasonable to have filename
completion for "set args" as this is now done on
most shells.

  I ran the testsuite with that patch on cygwin,
and the only difference I got was in gdb.trace/packetlen.exp
but I can't see any relation with the patch, and this
problem is probably due to some instabilities on
the cygwin testsuite. 

Is this OK to commit?


Pierre Muller

Pascal language support maintainer for GDB

ChangeLog entry:

2008-07-01  Pierre Muller  <muller@ics.u-strasbg.fr>

	cli/cli-decode.c (add_setshow_optional_filename_cmd): Set
	completer for set to filename_completer.


Index: gdb/cli/cli-decode.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-decode.c,v
retrieving revision 1.65
diff -u -p -r1.65 cli-decode.c
--- gdb/cli/cli-decode.c        3 May 2008 23:24:17 -0000       1.65
+++ gdb/cli/cli-decode.c        1 Jul 2008 15:27:41 -0000
@@ -539,11 +539,16 @@ add_setshow_optional_filename_cmd (char
                                   struct cmd_list_element **set_list,
                                   struct cmd_list_element **show_list)
 {
+  struct cmd_list_element *set_result;
+
   add_setshow_cmd_full (name, class, var_optional_filename, var,
                        set_doc, show_doc, help_doc,
                        set_func, show_func,
                        set_list, show_list,
-                       NULL, NULL);
+                       &set_result, NULL);
+
+  set_cmd_completer (set_result, filename_completer);
+
 }

 /* Add element named NAME to both the set and show command LISTs (the



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] use filename_completer for add_setshow_optional_filename_cmd
  2008-07-01 21:38 [RFA] use filename_completer for add_setshow_optional_filename_cmd Pierre Muller
@ 2008-07-01 22:03 ` Pedro Alves
  2008-07-04  6:17 ` Joel Brobecker
  2008-07-04 10:45 ` Eli Zaretskii
  2 siblings, 0 replies; 7+ messages in thread
From: Pedro Alves @ 2008-07-01 22:03 UTC (permalink / raw)
  To: gdb-patches; +Cc: Pierre Muller

(following the spirit of speaking up if you spent the time
 looking at the patch)

A Tuesday 01 July 2008 22:37:42, Pierre Muller wrote:
>   I discovered that
> set debug-file-directory does not use filename_completer.
>
>   This is because add_setshow_optional_filename_cmd
> does not set the set completer to filename completer,
> contrary to add_setshow_filename_cmd.
>
>   Is there any reason for this?
> Or is it just a bug?

IMHO, it's just a feature miss.

>   The following small patch fixes this
> by setting the set part completer to filename_completer
> for  add_setshow_optional_filename_cmd
> exactly as is done in add_setshow_filename_cmd.
>
>   There are currently only three adffected commands:
>
> "set debug-file-directory"
> "set args"
> "set solib-search-path"
>
>   Only the second one might be questionable,
> but I also find that it is reasonable to have filename
> completion for "set args" as this is now done on
> most shells.
>

IMHO, it does make more sense to have a filename completer
in "set args," than a default symbol completer.  You're normally
not very interested in passing symbol names as arguments to
your program.

> Is this OK to commit?

FWIW, looks good to me.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] use filename_completer for add_setshow_optional_filename_cmd
  2008-07-01 21:38 [RFA] use filename_completer for add_setshow_optional_filename_cmd Pierre Muller
  2008-07-01 22:03 ` Pedro Alves
@ 2008-07-04  6:17 ` Joel Brobecker
  2008-07-04 14:56   ` Pierre Muller
  2008-07-04 22:56   ` Pierre Muller
  2008-07-04 10:45 ` Eli Zaretskii
  2 siblings, 2 replies; 7+ messages in thread
From: Joel Brobecker @ 2008-07-04  6:17 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

> There are currently only three adffected commands:
> 
> "set debug-file-directory"
> "set args"
> "set solib-search-path"
> 
> Only the second one might be questionable, but I also find that it
> is reasonable to have filename completion for "set args" as this is
> now done on most shells.

I also agree that this is more useful than completing on symbols.

> 2008-07-01  Pierre Muller  <muller@ics.u-strasbg.fr>
> 
> 	cli/cli-decode.c (add_setshow_optional_filename_cmd): Set
> 	completer for set to filename_completer.

This change makes sense. Can you submit a NEWS entry describing the
new completion policy? The code update itself is approved.

Thank you,
-- 
Joel


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] use filename_completer for add_setshow_optional_filename_cmd
  2008-07-01 21:38 [RFA] use filename_completer for add_setshow_optional_filename_cmd Pierre Muller
  2008-07-01 22:03 ` Pedro Alves
  2008-07-04  6:17 ` Joel Brobecker
@ 2008-07-04 10:45 ` Eli Zaretskii
  2 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2008-07-04 10:45 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

> From: "Pierre Muller" <muller@ics.u-strasbg.fr>
> Date: Tue, 1 Jul 2008 23:37:42 +0200
> 
> 
>   I discovered that
> set debug-file-directory does not use filename_completer.
> 
>   This is because add_setshow_optional_filename_cmd
> does not set the set completer to filename completer,
> contrary to add_setshow_filename_cmd.
>   
>   Is there any reason for this?

Laziness.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [RFA] use filename_completer for add_setshow_optional_filename_cmd
  2008-07-04  6:17 ` Joel Brobecker
@ 2008-07-04 14:56   ` Pierre Muller
  2008-07-04 18:01     ` Eli Zaretskii
  2008-07-04 22:56   ` Pierre Muller
  1 sibling, 1 reply; 7+ messages in thread
From: Pierre Muller @ 2008-07-04 14:56 UTC (permalink / raw)
  To: 'Joel Brobecker'; +Cc: gdb-patches


What about this for NEWS:

diff -u -p -r1.277 NEWS
--- gdb/NEWS	11 Jun 2008 12:56:36 -0000	1.277
+++ gdb/NEWS	4 Jul 2008 11:35:19 -0000
@@ -3,6 +3,9 @@
 
 *** Changes since GDB 6.8
 
+* Commands `set debug-file-directory', `set solib-search-path' and `set
args'
+now complete on file names.
+
 * When completing in expressions, gdb will attempt to limit
 completions to allowable structure or union fields, where appropriate.
 For instance, consider:


The only problem is that for `set args' ,
there is a similar claim in NEWS dating back from
GDB 5.1 release....



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Joel Brobecker
> Envoyé : Friday, July 04, 2008 8:17 AM
> À : Pierre Muller
> Cc : gdb-patches@sourceware.org
> Objet : Re: [RFA] use filename_completer for
> add_setshow_optional_filename_cmd
> 
> > There are currently only three adffected commands:
> >
> > "set debug-file-directory"
> > "set args"
> > "set solib-search-path"
> >
> > Only the second one might be questionable, but I also find that it
> > is reasonable to have filename completion for "set args" as this is
> > now done on most shells.
> 
> I also agree that this is more useful than completing on symbols.
> 
> > 2008-07-01  Pierre Muller  <muller@ics.u-strasbg.fr>
> >
> > 	cli/cli-decode.c (add_setshow_optional_filename_cmd): Set
> > 	completer for set to filename_completer.
> 
> This change makes sense. Can you submit a NEWS entry describing the
> new completion policy? The code update itself is approved.
> 
> Thank you,
> --
> Joel



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] use filename_completer for add_setshow_optional_filename_cmd
  2008-07-04 14:56   ` Pierre Muller
@ 2008-07-04 18:01     ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2008-07-04 18:01 UTC (permalink / raw)
  To: Pierre Muller; +Cc: brobecker, gdb-patches

> From: "Pierre Muller" <muller@ics.u-strasbg.fr>
> Cc: <gdb-patches@sourceware.org>
> Date: Fri, 4 Jul 2008 16:55:27 +0200
> 
> 
> What about this for NEWS:
> 
> diff -u -p -r1.277 NEWS
> --- gdb/NEWS	11 Jun 2008 12:56:36 -0000	1.277
> +++ gdb/NEWS	4 Jul 2008 11:35:19 -0000
> @@ -3,6 +3,9 @@
>  
>  *** Changes since GDB 6.8
>  
> +* Commands `set debug-file-directory', `set solib-search-path' and `set
> args'
> +now complete on file names.
> +

Okay.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [RFA] use filename_completer for add_setshow_optional_filename_cmd
  2008-07-04  6:17 ` Joel Brobecker
  2008-07-04 14:56   ` Pierre Muller
@ 2008-07-04 22:56   ` Pierre Muller
  1 sibling, 0 replies; 7+ messages in thread
From: Pierre Muller @ 2008-07-04 22:56 UTC (permalink / raw)
  To: 'Joel Brobecker', 'Eli Zaretskii'; +Cc: gdb-patches

I have committed this patch together with the NEWS 
entry, approved by Eli.

Thanks to Joel and Eli,


Pierre Muller
Pascal language support maintainer for GDB



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Joel Brobecker
> Envoyé : Friday, July 04, 2008 8:17 AM
> À : Pierre Muller
> Cc : gdb-patches@sourceware.org
> Objet : Re: [RFA] use filename_completer for
> add_setshow_optional_filename_cmd
> 
> > There are currently only three adffected commands:
> >
> > "set debug-file-directory"
> > "set args"
> > "set solib-search-path"
> >
> > Only the second one might be questionable, but I also find that it
> > is reasonable to have filename completion for "set args" as this is
> > now done on most shells.
> 
> I also agree that this is more useful than completing on symbols.
> 
> > 2008-07-01  Pierre Muller  <muller@ics.u-strasbg.fr>
> >
> > 	cli/cli-decode.c (add_setshow_optional_filename_cmd): Set
> > 	completer for set to filename_completer.
> 
> This change makes sense. Can you submit a NEWS entry describing the
> new completion policy? The code update itself is approved.
> 
> Thank you,
> --
> Joel



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-07-04 22:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-01 21:38 [RFA] use filename_completer for add_setshow_optional_filename_cmd Pierre Muller
2008-07-01 22:03 ` Pedro Alves
2008-07-04  6:17 ` Joel Brobecker
2008-07-04 14:56   ` Pierre Muller
2008-07-04 18:01     ` Eli Zaretskii
2008-07-04 22:56   ` Pierre Muller
2008-07-04 10:45 ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox