9#ifndef LLDB_UTILITY_DIAGNOSTICS_H
10#define LLDB_UTILITY_DIAGNOSTICS_H
14#include "llvm/ADT/SmallVector.h"
15#include "llvm/ADT/StringSet.h"
16#include "llvm/Support/Error.h"
38 bool Dump(llvm::raw_ostream &stream);
39 bool Dump(llvm::raw_ostream &stream,
const FileSpec &dir);
42 void Report(llvm::StringRef message);
Diagnostics are a collection of files to help investigate bugs and troubleshoot issues.
RotatingLogHandler m_log_handler
bool Dump(llvm::raw_ostream &stream)
Gather diagnostics and print a message to the given output stream.
CallbackID AddCallback(Callback callback)
void Report(llvm::StringRef message)
llvm::Error DumpDiangosticsLog(const FileSpec &dir) const
llvm::SmallVector< CallbackEntry, 4 > m_callbacks
List of callback entries.
llvm::Error Create(const FileSpec &dir)
Gather diagnostics in the given directory.
CallbackID m_callback_id
Monotonically increasing callback identifier.
std::mutex m_callbacks_mutex
Mutex to protect callback list and callback identifier.
static llvm::Expected< FileSpec > CreateUniqueDirectory()
Create a unique diagnostic directory.
static std::optional< Diagnostics > & InstanceImpl()
std::function< llvm::Error(const FileSpec &)> Callback
void RemoveCallback(CallbackID id)
static Diagnostics & Instance()
A class that represents a running process on the host machine.
CallbackEntry(CallbackID id, Callback callback)