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

via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 3 10:43:10 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.
----------------
jimingham wrote:

This doesn't help me understand what "hidden" means.

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


More information about the lldb-commits mailing list