labath wrote:

This seems like it could be problematic for IDEs, if they don't print the error 
in the same window as the expression being evaluated. The arrows could end up 
pointing to nowhere, or to the wrong place in the expression (if we don't get 
the right offset).

I think this could be made simpler and more robust by just printing a 
reproduction of the expression as the first line of the error message. It 
saving that one line output worth it?

Also, how will this behave for multiline expressions? Or with errors that refer 
to multiple source locations (e.g inside macro expansions)?
```
(lldb) expr
Enter expressions, then terminate with an empty line to evaluate:
  1: #define FOO(x) foo+x 
  2: FOO(bar) 
error: <user expression 1>:2:1: use of undeclared identifier 'foo'
    2 | FOO(bar)
      | ^
<user expression 1>:1:16: expanded from macro 'FOO'
    1 | #define FOO(x) foo+x
      |                ^
error: <user expression 1>:2:5: use of undeclared identifier 'bar'
    2 | FOO(bar)
      |     ^
```

https://github.com/llvm/llvm-project/pull/106470
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to