[Lldb-commits] [lldb] [lldb][Expression] Reject languages not supported by TypeSystems for expression evaluation (PR #156648)

via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 3 10:30:02 PDT 2025


jimingham wrote:

For C in particular we have a "half-way between" mode where we allowed some keywords (like `class`) even though  we still used C++ reference semantics.  So for instance:

```
(lldb) run
Process 79429 launched: '/tmp/foo' (arm64)
Process 79429 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x0000000100000480 foo`main at foo.c:7
   4   	main()
   5   	{
   6   	  int class = 100;
-> 7   	  printf("class is: %d.\n", class);
    	                            ^
   8   	  return 0;
   9   	}
Target 0: (foo) stopped.
(lldb) expr -l C -- class = 110
(int) $0 = 110
(lldb) n
class is: 110.
Process 79429 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = step over
    frame #0: 0x000000010000049c foo`main at foo.c:8
   5   	{
   6   	  int class = 100;
   7   	  printf("class is: %d.\n", class);
-> 8   	  return 0;
    	  ^
   9   	}
Target 0: (foo) stopped.
(lldb) expr -l c++ -- class = 120
                      ^
                      error: declaration of anonymous class must be a definition
                      warning: declaration does not declare anything

```

That seems useful, does patch break that feature?

https://github.com/llvm/llvm-project/pull/156648


More information about the lldb-commits mailing list