clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

So it would be nice to try and not encode errors into the TraceInstruction 
class and deal with any errors at decode time.



================
Comment at: lldb/include/lldb/Target/Trace.h:31-32
+///
+/// This class assumes that errors will be extremely rare compared to the 
number
+/// of correct instructions and storing them as \a ConstString should be fine.
+class TraceInstruction {
----------------
Can't we just avoid including any errors in this TraceInstruction class? And 
have the function that generates these return a:

```
llvm::Expected<TraceInstruction>
```
?


================
Comment at: lldb/include/lldb/Target/Trace.h:75
+    lldb::addr_t m_load_address;
+    const char *m_error;
+  } m_data;
----------------
It would be nice to avoid trying to encode errors into this class.


================
Comment at: lldb/include/lldb/lldb-enumerations.h:786
+/// analysis on traces.
+enum TraceInstructionType : unsigned char {
+  /// The instruction is not recognized by LLDB
----------------



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103588/new/

https://reviews.llvm.org/D103588

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to