LLDB mainline
|
#include "lldb/Utility/Flags.h"
#include "lldb/lldb-defines.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/RWMutex.h"
#include <atomic>
#include <cstdarg>
#include <cstdint>
#include <memory>
#include <mutex>
#include <string>
#include <type_traits>
Go to the source code of this file.
Classes | |
class | lldb_private::LogHandler |
class | lldb_private::StreamLogHandler |
class | lldb_private::CallbackLogHandler |
class | lldb_private::RotatingLogHandler |
class | lldb_private::TeeLogHandler |
A T-style log handler that multiplexes messages to two log handlers. More... | |
class | lldb_private::Log |
struct | lldb_private::Log::Category |
class | lldb_private::Log::Channel |
Namespaces | |
namespace | llvm |
namespace | lldb_private |
A class that represents a running process on the host machine. | |
Macros | |
#define | LLDB_LOG_OPTION_VERBOSE (1u << 1) |
#define | LLDB_LOG_OPTION_PREPEND_SEQUENCE (1u << 3) |
#define | LLDB_LOG_OPTION_PREPEND_TIMESTAMP (1u << 4) |
#define | LLDB_LOG_OPTION_PREPEND_PROC_AND_THREAD (1u << 5) |
#define | LLDB_LOG_OPTION_PREPEND_THREAD_NAME (1U << 6) |
#define | LLDB_LOG_OPTION_BACKTRACE (1U << 7) |
#define | LLDB_LOG_OPTION_APPEND (1U << 8) |
#define | LLDB_LOG_OPTION_PREPEND_FILE_FUNCTION (1U << 9) |
#define | LLDB_LOG(log, ...) |
The LLDB_LOG* macros defined below are the way to emit log messages. | |
#define | LLDB_LOGF(log, ...) |
#define | LLDB_LOGV(log, ...) |
#define | LLDB_LOG_ERROR(log, error, ...) |
#define | LLDB_LOG_ERRORV(log, error, ...) |
Functions | |
template<typename Cat > | |
Log::Channel & | lldb_private::LogChannelFor ()=delete |
template<typename Cat > | |
Log * | lldb_private::GetLog (Cat mask) |
Retrieve the Log object for the channel associated with the given log enum. | |
#define LLDB_LOG | ( | log, | |
... | |||
) |
The LLDB_LOG* macros defined below are the way to emit log messages.
Note that the macros surround the arguments in a check for the log being on, so you can freely call methods in arguments without affecting the non-log execution flow.
If you need to do more complex computations to prepare the log message be sure to add your own if (log) check, since we don't want logging to have any effect when not on.
However, the LLDB_LOG macro uses the llvm::formatv system (see the ProgrammersManual page in the llvm docs for more details). This allows the use of "format_providers" to auto-format datatypes, and there are already formatters for some of the llvm and lldb datatypes.
So if you need to do non-trivial formatting of one of these types, be sure to grep the lldb and llvm sources for "format_provider" to see if there is already a formatter before doing in situ formatting, and if possible add a provider if one does not already exist.
#define LLDB_LOG_ERROR | ( | log, | |
error, | |||
... | |||
) |
#define LLDB_LOG_ERRORV | ( | log, | |
error, | |||
... | |||
) |
#define LLDB_LOGF | ( | log, | |
... | |||
) |
#define LLDB_LOGV | ( | log, | |
... | |||
) |