JDevlieghere marked an inline comment as done.
JDevlieghere added inline comments.


================
Comment at: lldb/source/Symbol/Symbol.cpp:44-49
+  if (!section_list)
+    return;
+
+  // This should've been caught during deserialization.
+  if (!symbol.value && !symbol.address)
+    return;
----------------
clayborg wrote:
> We probably should make this function into a static factory function that 
> returns a llvm::Expected<Symbol> so we can return an error if the symbol has 
> not value or address, and if we can't resolve the address in a section:
> ```
> llvm::Expected<Symbol> Symbol::CreateSymbol(const JSONSymbol &symbol, 
> SectionList *section_list);
> ```
> Then we can return errors for the above cases and also for below.
Do you prefer to handle the error here or during deserialization? Currently 
these things are enforced there. I don't think it makes sense to check the same 
invariant twice. I'm happy to move it here though if you think that's better.


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

https://reviews.llvm.org/D145180

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

Reply via email to