<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 --- - [lldb-mi] -var-assign doesn't accept some valid values"
   href="https://llvm.org/bugs/show_bug.cgi?id=30568">30568</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[lldb-mi] -var-assign doesn't accept some valid values
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.9
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>All
          </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@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>edmunoz@microsoft.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Related to <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [lldb-mi] -var-assign doesn't evaluate the expression to assign"
   href="show_bug.cgi?id=30423">https://llvm.org/bugs/show_bug.cgi?id=30423</a>

-var-assign should allow assigning certain values to variables. The supported
types seems to be ints and floats (different encodings).

For example, assigning a valid value such as "true", "false", "'a'" all fail.
These assignments succeed if the "equivalent" integer value is used instead (1,
0, 97 (ascii), respectively). Other debuggers like GDB do support these values
to be used with the command -var-assign.

Repro (where z is a boolean variable):

-var-create - - "z" --thread 1 --frame 0
^done,name="var2",numchild="0",value="true",type="bool",thread-id="1",has_more="0"
(gdb)
## Assigning "false" fails
-var-assign var2 "false"
^error,msg="expression could not be evaluated"
(gdb)
## Assigning "0" succeeds
-var-assign var2 "0"
^done,value="false"
(gdb)
-var-evaluate-expression var2
^done,value="false"
(gdb)


The expected behavior is the same as GDB:
-var-create - * "z"
^done,name="var1",numchild="0",value="true",type="bool",thread-id="1",has_more="0"
(gdb)
-var-assign var1 "false"
^done,value="false"
(gdb)
-var-evaluate-expression var1
^done,value="false"
(gdb)</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>