[Lldb-commits] [PATCH] D14197: Handle the options and parameters separator in every MI command

Ilia K via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 2 05:23:01 PST 2015


ki.stfu added inline comments.

================
Comment at: tools/lldb-mi/MICmdBase.cpp:102
@@ -99,2 +101,3 @@
     m_setCmdArgs.Add(new CMICmdArgValOptionLong(m_constStrArgFrame, m_FrameArgMandatory, true, CMICmdArgValListBase::eArgValType_Number, 1));
+    m_setCmdArgs.Add(new CMICmdArgValConsume(m_constStrArgConsume, false));
 }
----------------
abidh wrote:
> ki.stfu wrote:
> > Well, I thought it's mandatory argument according to its spec: https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Data-Manipulation.html
> > ```
> >       -data-disassemble
> >          [ -s start-addr -e end-addr ]
> >        | [ -f filename -l linenum [ -n lines ] ]
> >        -- mode
> > ```
> > 
> > But I think we can follow to the GDB syntax.
> If you read the following, you will see that "--" is not mandatory. It says "Options occur first in the parameter list and can be delimited from normal parameters using ‘--’ (this is useful when some parameters begin with a dash)."
> 
> https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Input-Syntax.html#GDB_002fMI-Input-Syntax
As for me, it says that dashes aren't mandatory in general cases (i.e. unless otherwise specified in command's spec). In case of -data-disassemble, we know that `mode` is either 0, 1, 2, or 3, and therefore according to your [[ https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Input-Syntax.html#GDB_002fMI-Input-Syntax | link ]], the syntax would be:
```
-data-disassemble [ -s start-addr -e end-addr ] | [ -f filename -l linenum [ -n lines ] ] [--] mode
```
(i.e. "--" is optional)

But the [[ https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Data-Manipulation.html | spec ]] says that '--' is mandatory argument and I perceive it as a special case of usage '--'. Therefore I supposed that it's mandatory argument.


http://reviews.llvm.org/D14197





More information about the lldb-commits mailing list