This patch is a reworking of Pete Lawrence's (@PortalPete) proposal for better expression evaluator error messages: https://github.com/llvm/llvm-project/pull/80938 Before: ``` $ lldb -o "expr a+b" (lldb) expr a+b error: <user expression 0>:1:1: use of undeclared identifier 'a' a+b ^ error: <user expression 0>:1:3: use of undeclared identifier 'b' a+b ^ ``` After: ``` (lldb) expr a+b ^ ^ │ ╰─ error: use of undeclared identifier 'b' ╰─ error: use of undeclared identifier 'a' ``` This eliminates the confusing `<user expression 0>:1:3` source location and avoids echoing the expression to the console again, which results in a cleaner presentation that makes it easier to grasp what's going on. You can't see it here, bug the word "error" is now also in color, if so desired. Depends on https://github.com/llvm/llvm-project/pull/106442.
10 lines
414 B
Plaintext
10 lines
414 B
Plaintext
// UNSUPPORTED: system-linux, system-windows
|
|
//
|
|
// RUN: %clangxx_host %p/Inputs/objc-cast.cpp -g -o %t
|
|
// RUN: %lldb %t \
|
|
// RUN: -o "b main" -o run -o "expression --language objc -- *(id)0x1" \
|
|
// RUN: 2>&1 | FileCheck %s
|
|
|
|
// CHECK: (lldb) expression --language objc -- *(id)0x1
|
|
// CHECK: error:{{.*}}Couldn't apply expression side effects : Couldn't dematerialize a result variable: couldn't read its memory
|