Skip to content

lldb inline diagnostics print unsupported characters to Windows terminal by default #142568

Open
@DavidSpickett

Description

@DavidSpickett

test.c:

int add(int n) { return 2 + n; }
int main() { return add(1); }

Compile with debug information:

C:\Users\tcwg>cl.exe test.c /Zi

Debug with lldb:

C:\Users\tcwg>llvm-worker\lldb-aarch64-windows\build\bin\lldb.exe test.exe
(lldb) target create "test.exe"
Current executable set to 'C:\Users\tcwg\test.exe' (aarch64).
(lldb) b main
Breakpoint 1: where = test.exe`main at test.c:2, address = 0x00000001400142b8
(lldb) run
Process 13376 launched: 'C:\Users\tcwg\test.exe' (aarch64)
Process 13376 stopped
* thread #1, stop reason = breakpoint 1.1
    frame #0: 0x00007ff6595a42b8 test.exe`main at test.c:2
   1    int add(int n) { return 2 + n; }
-> 2    int main() { return add(1); }

Evaluate an incorrect expression:

(lldb) p add("abc")
         ˄
         Γò░ΓöÇ error: no matching function for call to 'add'
note: note: candidate function not viable: no known conversion from 'const char[4]' to 'int' for 1st argument

This attempts to use what I think are unicode characters for curved lines, but this default Windows command prompt does not recognise them (neither does a Powershell, which is surprising).

Turning them off falls back to using just pipe characters:

(lldb) settings set show-inline-diagnostics false
(lldb) p add("abc")
error: <user expression 4>:1:1: no matching function for call to 'add'
    1 | add("abc")
      | ^~~
note: note: candidate function not viable: no known conversion from 'const char[4]' to 'int' for 1st argument

Ideally we would detect support for these characters in the terminal. I suspect the right "code page" might make this work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions