Attempting to evaluate an expression that contains a function call is broken on Linux. Sometimes, the expression is evaluated but the result is clearly incorrect: (lldb) expression -- (int)strlen("hello world") (int) $5 = -764888112 To reproduce the above, run: python dotest.py -i -v lang/c/strings Sometimes, the expression command itself returns an error: (lldb) print str.c_str() To reproduce the above, run: python dotest.py -i -v expression_command/call-function
*** Bug 14595 has been marked as a duplicate of this bug. ***
The failure to print str.c_str generates the following lldb error message: error: Execution was interrupted, reason: invalid address. This can also be reproduced with: (lldb) expr new int(12) which is also run by the following test case: python dotest.py -i -v expression_command/call-function (lldb) log enable lldb expr The logging facility includes the following output, whereas a non-null remote address is typical of successful expression evaluation: Code can be run in the target. Found function, has local address 0x7fab3bc01008 and remote address 0x0 Function's code range is [0x0+0x5e] Couldn't disassemble function : Couldn't read from process: Input/output error Data buffer contents:
In latest trunk (r175255) I can confirm that expressions with 'new' work. Re-enabling TestFormatters.py. Leaving this bug open as there's more work needed to fix expression evaluation on Linux.
This bug has been fixed since it was first filed.