================
@@ -9,15 +9,73 @@
 #ifndef LLDB_SYMBOL_SYMBOLLOCATOR_H
 #define LLDB_SYMBOL_SYMBOLLOCATOR_H
 
+#include "lldb/Core/ModuleSpec.h"
 #include "lldb/Core/PluginInterface.h"
+#include "lldb/Target/Statistics.h"
+#include "lldb/Utility/Status.h"
 #include "lldb/Utility/UUID.h"
 
+#include "llvm/Support/Error.h"
+
+#include <system_error>
+
 namespace lldb_private {
 
 class SymbolLocator : public PluginInterface {
 public:
   SymbolLocator() = default;
 
+  /// A binary was not found and nothing could say why. Its own error type, so
+  /// that a caller composing its own message for that case cannot mistake a
+  /// real failure for it.
+  class NotFound : public llvm::ErrorInfo<NotFound> {
+  public:
+    static char ID;
+
+    void log(llvm::raw_ostream &os) const override;
+    std::error_code convertToErrorCode() const override;
+  };
+
+  /// One binary to search for.
+  struct Request {
+    /// What to look for.
+    ModuleSpec module_spec;
+
+    /// Allow contacting an external symbol server when the local searches come
+    /// up empty.
+    bool external_lookup = false;
+  };
+
+  /// What a search found.
+  struct Result {
+    /// The binary, and its symbol file if there is one to be had.
+    ModuleSpec module_spec;
+
+    /// What an external symbol server had to say about the symbols, even
+    /// though the binary itself was found. Recorded rather than reported, so
+    /// that it reaches the user in the caller's order.
+    Status symbol_error;
----------------
bulbazord wrote:

You understood my question correctly. I was suggesting something like an 
llvm::Error. I'm trying to push back on using types that allow us to ignore 
errors implicitly. If we want to ignore them, we should intentionally drop it.

https://github.com/llvm/llvm-project/pull/215391
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to