GDB's command qualifier character is `/'

Andrew Cagney cagney@gnu.org
Tue Oct 21 19:29:00 GMT 2003


> 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



More information about the Gdb mailing list