[Bug 40947] New: LLDB compiled by gcc doesn't evaluate expressions on 32 bit

Bug ID 40947
Summary LLDB compiled by gcc doesn’t evaluate expressions on 32 bit
Product lldb
Version 5.0
Hardware PC
OS Linux
Status NEW
Severity normal
Priority P
Component All Bugs
Assignee lldb-dev@lists.llvm.org
Reporter m.aksenov@samsung.com
CC llvm-bugs@lists.llvm.org

I'm using LLDB cross-compiled by gcc on ARM. When I'm trying to evaluate a
simple expression (e.g. x+1), debugger gives an error message: "Expression
can't be run, because there is no JIT compiled function".

I think I've found the reason. In function
lldb_private::IRExecutionUnit::GetRunnableInfo there is a cast operator from
void* (32 bit in my case) to lldb::addr_t (64 bit). Pointer-to-integer
conversion is implementation defined as per the C99 standard and gcc performs
signed extension here. Further it compares with unsigned number (uintptr_t) in
IRExecutionUnit::GetRemoteAddressForLocal and address can't be found.