LLDB  mainline
ProcessPOSIXLog.cpp
Go to the documentation of this file.
1 //===-- ProcessPOSIXLog.cpp -----------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "ProcessPOSIXLog.h"
10 
11 #include "llvm/Support/Threading.h"
12 
13 using namespace lldb_private;
14 
15 static constexpr Log::Category g_categories[] = {
16  {{"break"}, {"log breakpoints"}, POSIXLog::Breakpoints},
17  {{"memory"}, {"log memory reads and writes"}, POSIXLog::Memory},
18  {{"process"}, {"log process events and activities"}, POSIXLog::Process},
19  {{"ptrace"}, {"log all calls to ptrace"}, POSIXLog::Ptrace},
20  {{"registers"}, {"log register read/writes"}, POSIXLog::Registers},
21  {{"thread"}, {"log thread events and activities"}, POSIXLog::Thread},
22  {{"watch"}, {"log watchpoint related activities"}, POSIXLog::Watchpoints},
23 };
24 
26 
28  return g_channel;
29 }
30 
32  static llvm::once_flag g_once_flag;
33  llvm::call_once(g_once_flag, []() { Log::Register("posix", g_channel); });
34 }
lldb_private::ProcessPOSIXLog::Initialize
static void Initialize()
Definition: ProcessPOSIXLog.cpp:31
lldb_private::Log::Register
static void Register(llvm::StringRef name, Channel &channel)
Definition: Log.cpp:197
lldb_private::POSIXLog::Ptrace
@ Ptrace
lldb_private::Log::Category
Definition: Log.h:130
lldb_private::LogChannelFor< POSIXLog >
Log::Channel & LogChannelFor< POSIXLog >()
Definition: ProcessPOSIXLog.cpp:27
g_categories
static constexpr Log::Category g_categories[]
Definition: ProcessPOSIXLog.cpp:15
lldb_private::POSIXLog::Memory
@ Memory
ProcessPOSIXLog.h
lldb_private::POSIXLog::Watchpoints
@ Watchpoints
lldb_private::Log::Channel
Definition: Log.h:146
lldb_private::POSIXLog::Registers
@ Registers
lldb_private::POSIXLog::Breakpoints
@ Breakpoints
lldb_private::POSIXLog::Thread
@ Thread
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::POSIXLog::Process
@ Process
g_channel
static Log::Channel g_channel(g_categories, POSIXLog::Process)