public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug cli/13831] New: gdb cli to be parsed for option "--args" instead of "--arg".
@ 2012-03-11 15:01 jb.1234abcd at gmail dot com
  2012-03-12 16:50 ` [Bug cli/13831] " palves at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jb.1234abcd at gmail dot com @ 2012-03-11 15:01 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13831

             Bug #: 13831
           Summary: gdb cli to be parsed for option "--args" instead of
                    "--arg".
           Product: gdb
           Version: 7.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: cli
        AssignedTo: unassigned@sourceware.org
        ReportedBy: jb.1234abcd@gmail.com
    Classification: Unclassified


gdb cli to be parsed for option "--args" instead of "--arg".

$ gdb -v    
GNU gdb (GDB) 7.4 [GDB v7.4 for FreeBSD]
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i386-portbld-freebsd9.0".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.

$ gdb --help
This is the GNU debugger.  Usage:

    gdb [options] [executable-file [core-file or process-id]]
    gdb [options] --args executable-file [inferior-arguments ...]

Options:

  --args             Arguments after executable-file are passed to inferior

$ gdb --arg prog1 1 2
GNU gdb (GDB) 7.4 [GDB v7.4 for FreeBSD]
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i386-portbld-freebsd9.0".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/home/jb/prog1...done.
(gdb) b main
Breakpoint 1 at 0x8048474: file prog1.c, line 13.
(gdb) r
Starting program: /usr/home/jb/prog1 1 2

Breakpoint 1, main (argc=3, argv=0xbfbfea50) at prog1.c:13
13      printf("argc=%d\n",argc);
(gdb) c
Continuing.
argc=3
argv[0]=/usr/home/jb/prog1
argv[1]=1
argv[2]=2
[Inferior 1 (process 14899) exited normally]
(gdb)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug cli/13831] gdb cli to be parsed for option "--args" instead of "--arg".
  2012-03-11 15:01 [Bug cli/13831] New: gdb cli to be parsed for option "--args" instead of "--arg" jb.1234abcd at gmail dot com
@ 2012-03-12 16:50 ` palves at redhat dot com
  2012-03-12 17:33 ` jb.1234abcd at gmail dot com
  2012-03-12 17:52 ` palves at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: palves at redhat dot com @ 2012-03-12 16:50 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13831

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING
                 CC|                            |palves at redhat dot com

--- Comment #1 from Pedro Alves <palves at redhat dot com> 2012-03-12 16:50:02 UTC ---
I'm afraid I don't understand what you're claiming is wrong.  Can you please
clarify?

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug cli/13831] gdb cli to be parsed for option "--args" instead of "--arg".
  2012-03-11 15:01 [Bug cli/13831] New: gdb cli to be parsed for option "--args" instead of "--arg" jb.1234abcd at gmail dot com
  2012-03-12 16:50 ` [Bug cli/13831] " palves at redhat dot com
@ 2012-03-12 17:33 ` jb.1234abcd at gmail dot com
  2012-03-12 17:52 ` palves at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: jb.1234abcd at gmail dot com @ 2012-03-12 17:33 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13831

--- Comment #2 from jb.1234abcd at gmail dot com 2012-03-12 17:33:34 UTC ---
(In reply to comment #1)
> I'm afraid I don't understand what you're claiming is wrong.  Can you please
> clarify?

Well, the format of gdb entry contains option keyword "--args", not "--arg".
It is important to parse any input properly. The entry should be rejected with
error msg like "Invalid format: --arg option".
I documented it for you.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug cli/13831] gdb cli to be parsed for option "--args" instead of "--arg".
  2012-03-11 15:01 [Bug cli/13831] New: gdb cli to be parsed for option "--args" instead of "--arg" jb.1234abcd at gmail dot com
  2012-03-12 16:50 ` [Bug cli/13831] " palves at redhat dot com
  2012-03-12 17:33 ` jb.1234abcd at gmail dot com
@ 2012-03-12 17:52 ` palves at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: palves at redhat dot com @ 2012-03-12 17:52 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13831

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID

--- Comment #3 from Pedro Alves <palves at redhat dot com> 2012-03-12 17:52:15 UTC ---
That's not a bug, it's a feature.

For long options (--foo), GNU getopt figures out what you wanted as long as its
not ambiguous.  E.g., try "ls --hel".

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

end of thread, other threads:[~2012-03-12 17:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-11 15:01 [Bug cli/13831] New: gdb cli to be parsed for option "--args" instead of "--arg" jb.1234abcd at gmail dot com
2012-03-12 16:50 ` [Bug cli/13831] " palves at redhat dot com
2012-03-12 17:33 ` jb.1234abcd at gmail dot com
2012-03-12 17:52 ` palves at redhat dot com

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).