public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* GDB's command qualifier character is `/'
@ 2003-10-19 16:50 Andrew Cagney
  2003-10-20  0:32 ` Daniel Jacobowitz
  2003-10-20 21:54 ` Jim Blandy
  0 siblings, 2 replies; 6+ messages in thread
From: Andrew Cagney @ 2003-10-19 16:50 UTC (permalink / raw)
  To: gdb

This seems to keep comming up, sigh!

GDB's CLI, long ago established `/' as its command qualifier character vis:

	x/i
	display/i
	print/x

GDB's user base is very familar with this syntax(1) so adding new 
qualfiers using this syntax would provide a consistent user experience 
(if there is x/i, how come there isn't "info break/l"?).

In fact, in the case of all these specific commands (including "info 
break/l") trying to switch to UNIX's option syntax vis:

	x --i

would be a disaster!

What's unfortunate in all this is that the current CLI code doesn't 
directly parse the qualifier convention.  For instance:

	(gdb) x<TAB>
	x/i x/b x/8 x/4
and
	(gdb) load/vma /lma
(load, using vma addresses, the file "/lma").

If the command doesn't involve files, though, I can't think of a reason 
for not using the `/' qualifier.  If it does involve files, then I guess 
  the work needed to add the qualifier will need to include modifing the 
cli.

Note that this doesn't address "parameterized qualifiers" (tar/dump 
convention?) and "qualified parameters" (not allowed?).

enjoy,
Andrew

(1) Personally, I'm always using the `/' qualifier, but I can't remember 
when, if ever, I used one of the UNIX style command options.

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

* Re: GDB's command qualifier character is `/'
  2003-10-19 16:50 GDB's command qualifier character is `/' Andrew Cagney
@ 2003-10-20  0:32 ` Daniel Jacobowitz
  2003-10-21 19:29   ` Andrew Cagney
  2003-10-20 21:54 ` Jim Blandy
  1 sibling, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2003-10-20  0:32 UTC (permalink / raw)
  To: gdb

On Sun, Oct 19, 2003 at 12:50:26PM -0400, Andrew Cagney wrote:
> This seems to keep comming up, sigh!
> 
> GDB's CLI, long ago established `/' as its command qualifier character vis:
> 
> 	x/i
> 	display/i
> 	print/x
> 
> GDB's user base is very familar with this syntax(1) so adding new 
> qualfiers using this syntax would provide a consistent user experience 
> (if there is x/i, how come there isn't "info break/l"?).
> 
> In fact, in the case of all these specific commands (including "info 
> break/l") trying to switch to UNIX's option syntax vis:
> 
> 	x --i
> 
> would be a disaster!

I stand by my previous disagreement with this position.

All of the currently accepted / options that I can find are output
format qualifiers.  I find nothing strange or inconsistent about using
a different syntax for options and for output qualifiers.  GDB doesn't
have any examples of
  break /shlib libc.so.6 round
or
  break /shlib:libc.so.6 round

only
  print/x round

I don't think x/i is prior art for break /shlib.

> What's unfortunate in all this is that the current CLI code doesn't 
> directly parse the qualifier convention.  For instance:
> 
> 	(gdb) x<TAB>
> 	x/i x/b x/8 x/4
> and
> 	(gdb) load/vma /lma
> (load, using vma addresses, the file "/lma").

Yes, this is unfortunate - at least in the minor bit that it generates
some strange error messages.  Almost nothing is centrally parsed in the
CLI and that's a shame.

> (1) Personally, I'm always using the `/' qualifier, but I can't remember 
> when, if ever, I used one of the UNIX style command options.

That's because there are very few commands in all of GDB's CLI which
_take_ options.  /, -, or otherwise.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

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

* Re: GDB's command qualifier character is `/'
  2003-10-19 16:50 GDB's command qualifier character is `/' Andrew Cagney
  2003-10-20  0:32 ` Daniel Jacobowitz
@ 2003-10-20 21:54 ` Jim Blandy
  1 sibling, 0 replies; 6+ messages in thread
From: Jim Blandy @ 2003-10-20 21:54 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb


Andrew Cagney <cagney@gnu.org> writes:
> GDB's CLI, long ago established `/' as its command qualifier character vis:
> 
> 	x/i
> 	display/i
> 	print/x
> 
> GDB's user base is very familar with this syntax(1) so adding new
> qualfiers using this syntax would provide a consistent user experience
> (if there is x/i, how come there isn't "info break/l"?).

I think / is only for format specifiers, not a general-purpose command
qualifier thing.

It seems to me that GDB has tended to use words for command
qualifiers, like:

  break foo if x == 10
  break foo thread 4
  `append [binary] memory FILENAME START_ADDR END_ADDR'
  `append [binary] value FILENAME EXPR'

We do have some existing examples of Unix-like command options:

  `symbol-file FILENAME [ -readnow ] [ -mapped ]'
  `file FILENAME [ -readnow ] [ -mapped ]'

  `add-symbol-file FILENAME ADDRESS'
  `add-symbol-file FILENAME ADDRESS [ -readnow ] [ -mapped ]'
  `add-symbol-file FILENAME -sSECTION ADDRESS ...'

I'd love to see discussion about how to pull these things together a
bit more, but I think it's difficult to argue that there is a
consistent rule in place already.

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

* Re: GDB's command qualifier character is `/'
  2003-10-20  0:32 ` Daniel Jacobowitz
@ 2003-10-21 19:29   ` Andrew Cagney
  2003-10-22  9:56     ` Andreas Schwab
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cagney @ 2003-10-21 19:29 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb


> All of the currently accepted / options that I can find are output
> format qualifiers.

While:
   /d /f /c
are certainly format qualfiers, I don't think repeat counts:
   /2 /16 ...
or size:
   /b /h /w /g
can be interpreted that way.  For instance

	(gdb) x/8 $pc
	...
	(gdb) print/8 main
	Item count other than 1 is meaningless in "print" command.
	(gdb) print/g main
	Size letters are meaningless in "print" command.

Note that the current code doesn't separate single letter qualfiers with 
a `/' ("x/8/f/g" isn't valid).  But tweaking the code to do this is 
easy, and I don't expect users to notice.

Also note that GDB's lack of a strong parser means that:
	x /8 $pc
is interpreted as:
	x/8 $pc

>  I find nothing strange or inconsistent about using
> a different syntax for options and for output qualifiers.  GDB doesn't
> have any examples of
>   break /shlib libc.so.6 round
> or
>   break /shlib:libc.so.6 round

``Note that this doesn't address "parameterized qualifiers" (tar/dump 
convention?) and "qualified parameters" (not allowed?)''.

To expand on "tar/dump convention", tar/dump put the parameters after 
the qualifiers vis:

	break/shlib libc.so.6 round

(it could get confusing if multiple qualfiers required parameters as 
occures with "tar xbf 1024 -").  So:

	break/shlib=libc.so.6 round

might be better ("=" avoids the shift key needed by ":").

>> (1) Personally, I'm always using the `/' qualifier, but I can't remember 
>> when, if ever, I used one of the UNIX style command options.
> 
> 
> That's because there are very few commands in all of GDB's CLI which
> _take_ options.  /, -, or otherwise.

The question to ask isn't how many commands use each syntax, but rather 
how many users use each syntax.  As a user, I use `/..' every day.   As 
a user, I don't think I've ever used `-...' syntax and only know of it 
because I've looked at the code.

Andrew

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

* Re: GDB's command qualifier character is `/'
  2003-10-21 19:29   ` Andrew Cagney
@ 2003-10-22  9:56     ` Andreas Schwab
  2003-10-22 14:38       ` Andrew Cagney
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2003-10-22  9:56 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: Daniel Jacobowitz, gdb

Andrew Cagney <cagney@gnu.org> writes:

> 	break/shlib=libc.so.6 round
>
> might be better ("=" avoids the shift key needed by ":").

Don't argue with keyboard layouts, they are different everywhere.  On a
German keyboard, for example, "=" is still shifted.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: GDB's command qualifier character is `/'
  2003-10-22  9:56     ` Andreas Schwab
@ 2003-10-22 14:38       ` Andrew Cagney
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Cagney @ 2003-10-22 14:38 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Daniel Jacobowitz, gdb

> Andrew Cagney <cagney@gnu.org> writes:
> 
> 
>> 	break/shlib=libc.so.6 round
>>
>> might be better ("=" avoids the shift key needed by ":").
> 
> 
> Don't argue with keyboard layouts, they are different everywhere.  On a
> German keyboard, for example, "=" is still shifted.

Bah!  I need to collect more keyboards.

Andrew


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

end of thread, other threads:[~2003-10-22 14:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-19 16:50 GDB's command qualifier character is `/' Andrew Cagney
2003-10-20  0:32 ` Daniel Jacobowitz
2003-10-21 19:29   ` Andrew Cagney
2003-10-22  9:56     ` Andreas Schwab
2003-10-22 14:38       ` Andrew Cagney
2003-10-20 21:54 ` Jim Blandy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).