Path: blob/main/contrib/llvm-project/lldb/source/Utility/LLDBLog.cpp
39587 views
//===-- LLDBLog.cpp -------------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "lldb/Utility/LLDBLog.h"9#include "lldb/Utility/Log.h"10#include "llvm/ADT/ArrayRef.h"11#include <cstdarg>1213using namespace lldb_private;1415static constexpr Log::Category g_categories[] = {16{{"api"}, {"log API calls and return values"}, LLDBLog::API},17{{"ast"}, {"log AST"}, LLDBLog::AST},18{{"break"}, {"log breakpoints"}, LLDBLog::Breakpoints},19{{"commands"}, {"log command argument parsing"}, LLDBLog::Commands},20{{"comm"}, {"log communication activities"}, LLDBLog::Communication},21{{"conn"}, {"log connection details"}, LLDBLog::Connection},22{{"demangle"},23{"log mangled names to catch demangler crashes"},24LLDBLog::Demangle},25{{"dyld"},26{"log shared library related activities"},27LLDBLog::DynamicLoader},28{{"event"},29{"log broadcaster, listener and event queue activities"},30LLDBLog::Events},31{{"expr"}, {"log expressions"}, LLDBLog::Expressions},32{{"formatters"},33{"log data formatters related activities"},34LLDBLog::DataFormatters},35{{"host"}, {"log host activities"}, LLDBLog::Host},36{{"jit"}, {"log JIT events in the target"}, LLDBLog::JITLoader},37{{"language"}, {"log language runtime events"}, LLDBLog::Language},38{{"mmap"}, {"log mmap related activities"}, LLDBLog::MMap},39{{"module"},40{"log module activities such as when modules are created, destroyed, "41"replaced, and more"},42LLDBLog::Modules},43{{"object"},44{"log object construction/destruction for important objects"},45LLDBLog::Object},46{{"os"}, {"log OperatingSystem plugin related activities"}, LLDBLog::OS},47{{"platform"}, {"log platform events and activities"}, LLDBLog::Platform},48{{"process"}, {"log process events and activities"}, LLDBLog::Process},49{{"script"}, {"log events about the script interpreter"}, LLDBLog::Script},50{{"state"},51{"log private and public process state changes"},52LLDBLog::State},53{{"step"}, {"log step related activities"}, LLDBLog::Step},54{{"symbol"}, {"log symbol related issues and warnings"}, LLDBLog::Symbols},55{{"system-runtime"}, {"log system runtime events"}, LLDBLog::SystemRuntime},56{{"target"}, {"log target events and activities"}, LLDBLog::Target},57{{"temp"}, {"log internal temporary debug messages"}, LLDBLog::Temporary},58{{"thread"}, {"log thread events and activities"}, LLDBLog::Thread},59{{"types"}, {"log type system related activities"}, LLDBLog::Types},60{{"unwind"}, {"log stack unwind activities"}, LLDBLog::Unwind},61{{"watch"}, {"log watchpoint related activities"}, LLDBLog::Watchpoints},62{{"on-demand"},63{"log symbol on-demand related activities"},64LLDBLog::OnDemand},65{{"source"}, {"log source related activities"}, LLDBLog::Source},66};6768static Log::Channel g_log_channel(g_categories,69LLDBLog::Process | LLDBLog::Thread |70LLDBLog::DynamicLoader |71LLDBLog::Breakpoints |72LLDBLog::Watchpoints | LLDBLog::Step |73LLDBLog::State | LLDBLog::Symbols |74LLDBLog::Target | LLDBLog::Commands);7576template <> Log::Channel &lldb_private::LogChannelFor<LLDBLog>() {77return g_log_channel;78}7980void lldb_private::InitializeLldbChannel() {81Log::Register("lldb", g_log_channel);82}838485