[Bug 30568] New: [lldb-mi] -var-assign doesn't accept some valid values

Bug ID 30568
Summary [lldb-mi] -var-assign doesn’t accept some valid values
Product lldb
Version 3.9
Hardware PC
OS All
Status NEW
Severity normal
Priority P
Component All Bugs
Assignee lldb-dev@lists.llvm.org
Reporter edmunoz@microsoft.com
CC llvm-bugs@lists.llvm.org
Classification Unclassified

Related to https://llvm.org/bugs/show_bug.cgi?id=30423

-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
## Assigning "false" fails
-var-assign var2 "false"
^error,msg="expression could not be evaluated"
## Assigning "0" succeeds
-var-assign var2 "0"
-var-evaluate-expression var2

The expected behavior is the same as GDB:
-var-create - * "z"
-var-assign var1 "false"
-var-evaluate-expression var1

abidh changed bug 30568