Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfc] Bug fixes for CLI "show" command
@ 2004-04-19 20:00 Daniel Jacobowitz
  2004-04-21 14:55 ` Andrew Cagney
  2004-05-10 18:17 ` Daniel Jacobowitz
  0 siblings, 2 replies; 10+ messages in thread
From: Daniel Jacobowitz @ 2004-04-19 20:00 UTC (permalink / raw)
  To: gdb-patches

There are two problems with the current "show" command.  One is that
prefixes get doubled.  Type "show" at a GDB prompt:

trust-readonly-sections:  Mode for reading from readonly sections is off.
tui tui active-border-mode:  The attribute mode to use for the active TUI window border is
    "bold-standout".
tui border-kind:  The kind of border for TUI windows is "acs".
tui border-mode:  The attribute mode to use for the TUI window borders is "normal".

See the doubled "tui" in the second line?

The other problem is that it assumes the first five characters of the prefix
are "show ".  I wanted to add a submenu to "maintenance show", so I needed
to use strstr here.

I've committed this to the intercu branch.  If no one has comments I'll
commit it to mainline in a day or two.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2004-04-19  Daniel Jacobowitz  <drow@mvista.com>

	* cli/cli-setshow.c (cmd_show_list): Check for "show" in the middle
	of prefixes.  Don't print the prefix twice in the CLI.

Index: cli/cli-setshow.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-setshow.c,v
retrieving revision 1.13.12.1
diff -u -p -r1.13.12.1 cli-setshow.c
--- cli/cli-setshow.c	27 Mar 2004 17:37:55 -0000	1.13.12.1
+++ cli/cli-setshow.c	19 Apr 2004 19:55:47 -0000
@@ -364,8 +364,10 @@ cmd_show_list (struct cmd_list_element *
 	{
 	  struct cleanup *optionlist_chain
 	    = make_cleanup_ui_out_tuple_begin_end (uiout, "optionlist");
-	  ui_out_field_string (uiout, "prefix", list->prefixname + 5);
-	  cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5);
+	  char *new_prefix = strstr (list->prefixname, "show ") + 5;
+	  if (ui_out_is_mi_like_p (uiout))
+	    ui_out_field_string (uiout, "prefix", new_prefix);
+	  cmd_show_list (*list->prefixlist, from_tty, new_prefix);
 	  /* Close the tuple.  */
 	  do_cleanups (optionlist_chain);
 	}


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

* Re: [rfc] Bug fixes for CLI "show" command
  2004-04-19 20:00 [rfc] Bug fixes for CLI "show" command Daniel Jacobowitz
@ 2004-04-21 14:55 ` Andrew Cagney
  2004-04-21 14:59   ` Daniel Jacobowitz
  2004-04-21 21:48   ` Jason Molenda
  2004-05-10 18:17 ` Daniel Jacobowitz
  1 sibling, 2 replies; 10+ messages in thread
From: Andrew Cagney @ 2004-04-21 14:55 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> -	  ui_out_field_string (uiout, "prefix", list->prefixname + 5);
> -	  cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5);
> +	  char *new_prefix = strstr (list->prefixname, "show ") + 5;

This is no better - i18n.

Andrew



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

* Re: [rfc] Bug fixes for CLI "show" command
  2004-04-21 14:55 ` Andrew Cagney
@ 2004-04-21 14:59   ` Daniel Jacobowitz
  2004-04-21 15:49     ` Andrew Cagney
  2004-04-21 21:48   ` Jason Molenda
  1 sibling, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2004-04-21 14:59 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

On Tue, Apr 20, 2004 at 01:34:22PM -0400, Andrew Cagney wrote:
> >-	  ui_out_field_string (uiout, "prefix", list->prefixname + 5);
> >-	  cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5);
> >+	  char *new_prefix = strstr (list->prefixname, "show ") + 5;
> 
> This is no better - i18n.

Well, "this is no better from an i18n perspective".  That doesn't mean
it isn't better!  I'm trying to solve the cosmetic bug, not clear the
road for later i18n, which will require changing all this anyway.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: [rfc] Bug fixes for CLI "show" command
  2004-04-21 14:59   ` Daniel Jacobowitz
@ 2004-04-21 15:49     ` Andrew Cagney
  2004-04-21 15:53       ` Daniel Jacobowitz
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew Cagney @ 2004-04-21 15:49 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> On Tue, Apr 20, 2004 at 01:34:22PM -0400, Andrew Cagney wrote:
> 
>>>> >-	  ui_out_field_string (uiout, "prefix", list->prefixname + 5);
>>>> >-	  cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5);
>>>> >+	  char *new_prefix = strstr (list->prefixname, "show ") + 5;
>>
>>> 
>>> This is no better - i18n.
> 
> 
> Well, "this is no better from an i18n perspective".  That doesn't mean
> it isn't better!  I'm trying to solve the cosmetic bug, not clear the
> road for later i18n, which will require changing all this anyway.

If we touch any i18n breakage, we should fix it.  Just like, if we break 
any deprecated code, we should fix it.

Andrew



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

* Re: [rfc] Bug fixes for CLI "show" command
  2004-04-21 15:49     ` Andrew Cagney
@ 2004-04-21 15:53       ` Daniel Jacobowitz
  2004-04-21 18:39         ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2004-04-21 15:53 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

On Wed, Apr 21, 2004 at 11:49:28AM -0400, Andrew Cagney wrote:
> >On Tue, Apr 20, 2004 at 01:34:22PM -0400, Andrew Cagney wrote:
> >
> >>>>>-	  ui_out_field_string (uiout, "prefix", list->prefixname + 5);
> >>>>>-	  cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5);
> >>>>>+	  char *new_prefix = strstr (list->prefixname, "show ") + 5;
> >>
> >>>
> >>>This is no better - i18n.
> >
> >
> >Well, "this is no better from an i18n perspective".  That doesn't mean
> >it isn't better!  I'm trying to solve the cosmetic bug, not clear the
> >road for later i18n, which will require changing all this anyway.
> 
> If we touch any i18n breakage, we should fix it.  Just like, if we break 
> any deprecated code, we should fix it.

I am not interested in reworking the interface of widely used functions
to support i18n, when there is no comprehensive plan or anyone working
on i18n support for GDB.  Is that really unreasonable?  It's just
wasted work!

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: [rfc] Bug fixes for CLI "show" command
  2004-04-21 15:53       ` Daniel Jacobowitz
@ 2004-04-21 18:39         ` Eli Zaretskii
  2004-04-21 19:26           ` Andrew Cagney
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2004-04-21 18:39 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: cagney, gdb-patches

> > If we touch any i18n breakage, we should fix it.  Just like, if we break 
> > any deprecated code, we should fix it.
> 
> I am not interested in reworking the interface of widely used functions
> to support i18n, when there is no comprehensive plan or anyone working
> on i18n support for GDB.  Is that really unreasonable?  It's just
> wasted work!

FWIW, I think we should not introduce new i18n problems, even though
we don't actively work on adding i18n support at this time.


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

* Re: [rfc] Bug fixes for CLI "show" command
  2004-04-21 18:39         ` Eli Zaretskii
@ 2004-04-21 19:26           ` Andrew Cagney
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Cagney @ 2004-04-21 19:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Daniel Jacobowitz, gdb-patches

>>>> > If we touch any i18n breakage, we should fix it.  Just like, if we break 
>>>> > any deprecated code, we should fix it.
>>
>>> 
>>> I am not interested in reworking the interface of widely used functions
>>> to support i18n, when there is no comprehensive plan or anyone working
>>> on i18n support for GDB.  Is that really unreasonable?  It's just
>>> wasted work!
> 
> 
> FWIW, I think we should not introduce new i18n problems, even though
> we don't actively work on adding i18n support at this time.

Yep.  We've even got some i18n patches submitted (why I created the i18n 
category in the bug database).

The only interface that needs reworking is add_setshow_cmd.  The old 
code (using add_set_cmd and add_set_from_show) can be pushed to one side.

Andrew



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

* Re: [rfc] Bug fixes for CLI "show" command
  2004-04-21 14:55 ` Andrew Cagney
  2004-04-21 14:59   ` Daniel Jacobowitz
@ 2004-04-21 21:48   ` Jason Molenda
  2004-04-21 22:22     ` Andrew Cagney
  1 sibling, 1 reply; 10+ messages in thread
From: Jason Molenda @ 2004-04-21 21:48 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches, Daniel Jacobowitz

Hi Andrew,

On Apr 20, 2004, at 10:34 AM, Andrew Cagney wrote:

>> -	  ui_out_field_string (uiout, "prefix", list->prefixname + 5);
>> -	  cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5);
>> +	  char *new_prefix = strstr (list->prefixname, "show ") + 5;
>
> This is no better - i18n.

I don't understand - is there actual intention to internationalize the 
gdb commands themselves?  When we talk about i18n'ing gdb, my reaction 
would be internationalizing the _output messages_ -- the errors, the 
warnings, the help text.  Do you mean to say that it's a goal of yours 
to support something like

(gdb) 表示environment

in place of "show environment".  Or 「(gdb) 表示環境」 (which is just painful 
to the eye in either language :-) to make it all Japanese.

Just MHO, but internationalizing the actual gdb commands is not 
particularly helpful for non-English native speakers.  
Internationalizing help/warning/errors would be very useful for them.  
Am I misunderstanding Daniel's patch?

Jason


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

* Re: [rfc] Bug fixes for CLI "show" command
  2004-04-21 21:48   ` Jason Molenda
@ 2004-04-21 22:22     ` Andrew Cagney
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Cagney @ 2004-04-21 22:22 UTC (permalink / raw)
  To: Jason Molenda; +Cc: gdb-patches, Daniel Jacobowitz

> Hi Andrew,
> 
> On Apr 20, 2004, at 10:34 AM, Andrew Cagney wrote:
> 
>>> -      ui_out_field_string (uiout, "prefix", list->prefixname + 5);
>>> -      cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5);
>>> +      char *new_prefix = strstr (list->prefixname, "show ") + 5;
>>
>>
>> This is no better - i18n.
> 
> 
> I don't understand - is there actual intention to internationalize the gdb commands themselves?  When we talk about i18n'ing gdb, my reaction would be internationalizing the _output messages_ -- the errors, the warnings, the help text.  Do you mean to say that it's a goal of yours to support something like 

Ah (no), in that case never mind.

Andrew



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

* Re: [rfc] Bug fixes for CLI "show" command
  2004-04-19 20:00 [rfc] Bug fixes for CLI "show" command Daniel Jacobowitz
  2004-04-21 14:55 ` Andrew Cagney
@ 2004-05-10 18:17 ` Daniel Jacobowitz
  1 sibling, 0 replies; 10+ messages in thread
From: Daniel Jacobowitz @ 2004-05-10 18:17 UTC (permalink / raw)
  To: gdb-patches

On Mon, Apr 19, 2004 at 04:00:05PM -0400, Daniel Jacobowitz wrote:
> There are two problems with the current "show" command.  One is that
> prefixes get doubled.  Type "show" at a GDB prompt:
> 
> trust-readonly-sections:  Mode for reading from readonly sections is off.
> tui tui active-border-mode:  The attribute mode to use for the active TUI window border is
>     "bold-standout".
> tui border-kind:  The kind of border for TUI windows is "acs".
> tui border-mode:  The attribute mode to use for the TUI window borders is "normal".
> 
> See the doubled "tui" in the second line?
> 
> The other problem is that it assumes the first five characters of the prefix
> are "show ".  I wanted to add a submenu to "maintenance show", so I needed
> to use strstr here.

I've checked this in.

-- 
Daniel Jacobowitz


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

end of thread, other threads:[~2004-05-10 18:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-19 20:00 [rfc] Bug fixes for CLI "show" command Daniel Jacobowitz
2004-04-21 14:55 ` Andrew Cagney
2004-04-21 14:59   ` Daniel Jacobowitz
2004-04-21 15:49     ` Andrew Cagney
2004-04-21 15:53       ` Daniel Jacobowitz
2004-04-21 18:39         ` Eli Zaretskii
2004-04-21 19:26           ` Andrew Cagney
2004-04-21 21:48   ` Jason Molenda
2004-04-21 22:22     ` Andrew Cagney
2004-05-10 18:17 ` Daniel Jacobowitz

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