<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Output from stack-list-locals and stack-list-arguments MI commands missing type information"
   href="https://llvm.org/bugs/show_bug.cgi?id=23326">23326</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Output from stack-list-locals and stack-list-arguments MI commands missing type information
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>vadim.macagon@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14248" name="attach_14248" title="Source for test executable">attachment 14248</a> <a href="attachment.cgi?id=14248&action=edit" title="Source for test executable">[details]</a></span>
Source for test executable

The stack-list-locals and stack-list-arguments MI commands have three output
modes, described as follows:
[0|--no-values] - Only variable/argument names are output.
[1|--all-values] - Variable/argument names and values are output.
[2|--simple-values] - Variable/argument names, values, and types are output for
simple types, but only names and types are output for complex types (like
arrays, structs, unions, etc.)

Full descriptions of these MI commands are available at
<<a href="https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Stack-Manipulation.html#GDB_002fMI-Stack-Manipulation">https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Stack-Manipulation.html#GDB_002fMI-Stack-Manipulation</a>>

It is the --simple-values output mode that hasn't been implemented properly in
the LLDB MI driver, no type information is output at all. Here's an example of
what GDB and LLDB output for the '-stack-list-arguments --simple-values'
command:

GDB-MI:
^done,stack-args=[frame={level="0",args=[]},frame={level="1",args=[]},frame={level="2",args=[{name="argc",type="int",value="1"},{name="argv",type="const
char **",value="0x7fffffffde68"}]}]

LLDB-MI:
^done,stack-args=[frame={level="0",args=[]},frame={level="1",args=[]},frame={level="2",args=[{name="argc",value="1"},{name="argv",value="0x00007fffffffee58"}]}]


And here's an example of what GDB and LLDB output for the '-stack-list-locals
--simple-values' command:

GDB-MI:
^done,locals=[{name="e",type="Point"},{name="f",type="float",value="9.5"},{name="g",type="long",value="300"}]

LLDB-MI:
^done,locals=[name="e",{name="f",value="9.5"},{name="g",value="300"}]

Note that aside from missing type information in the LLDB-MI response above,
it's not even grammatically correct, according to the 'list' rule a list
delimited by [] should either contain only results (key=value), or only values.
In this case the grammatically correct output would've been:

^done,locals=[{name="e"},{name="f",value="9.5"},{name="g",value="300"}]

I've attached the source file I've used to produce the example output in this
bug report, once built in debug mode the following MI commands can be used to
reproduce the examples in GDB (gdb --interperter mi) or LLDB (lldb-mi
--interperter):

-file-exec-and-symbols path/to/test_target
-break-insert funcWithThreeLocalVariables_Inner
-exec-run
-stack-list-arguments 2
-stack-list-locals --frame 1 --thread 1 2

Note that LLDB outputs a couple of extra frames for stack-list-arguments that
I've omitted from the example output above.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>