[Lldb-commits] [lldb] Support inline diagnostics in CommandReturnObject (PR #110901)

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 4 09:36:43 PDT 2024


================
@@ -26,6 +27,35 @@ class raw_ostream;
 
 namespace lldb_private {
 
+/// A compiler-independent representation of a Diagnostic. Expression
+/// evaluation failures often have more than one diagnostic that a UI
+/// layer might want to render differently, for example to colorize
+/// it.
+///
+/// Running example:
+///   (lldb) expr 1+foo
+///   error: <user expression 0>:1:3: use of undeclared identifier 'foo'
+///   1+foo
+///     ^
+struct DiagnosticDetail {
+  struct SourceLocation {
+    FileSpec file;
+    unsigned line = 0;
+    uint16_t column = 0;
+    uint16_t length = 0;
+    bool hidden = false;
+    bool in_user_input = false;
+  };
+  /// Contains {{}, 1, 3, 3, true} in the example above.
----------------
adrian-prantl wrote:

I updated the documentation, thanks for pointing this out!

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


More information about the lldb-commits mailing list