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"}, POSIX_LOG_BREAKPOINTS},
17  {{"memory"}, {"log memory reads and writes"}, POSIX_LOG_MEMORY},
18  {{"process"}, {"log process events and activities"}, POSIX_LOG_PROCESS},
19  {{"ptrace"}, {"log all calls to ptrace"}, POSIX_LOG_PTRACE},
20  {{"registers"}, {"log register read/writes"}, POSIX_LOG_REGISTERS},
21  {{"thread"}, {"log thread events and activities"}, POSIX_LOG_THREAD},
22  {{"watch"}, {"log watchpoint related activities"}, POSIX_LOG_WATCHPOINTS},
23 };
24 
26 
28  static llvm::once_flag g_once_flag;
29  llvm::call_once(g_once_flag, []() { Log::Register("posix", g_channel); });
30 }
POSIX_LOG_THREAD
#define POSIX_LOG_THREAD
Definition: ProcessPOSIXLog.h:17
lldb_private::ProcessPOSIXLog::Initialize
static void Initialize()
Definition: ProcessPOSIXLog.cpp:27
lldb_private::Log::Register
static void Register(llvm::StringRef name, Channel &channel)
Definition: Log.cpp:189
POSIX_LOG_PROCESS
#define POSIX_LOG_PROCESS
Definition: ProcessPOSIXLog.h:16
lldb_private::Log::Category
Definition: Log.h:52
POSIX_LOG_REGISTERS
#define POSIX_LOG_REGISTERS
Definition: ProcessPOSIXLog.h:20
g_categories
static constexpr Log::Category g_categories[]
Definition: ProcessPOSIXLog.cpp:15
ProcessPOSIXLog.h
lldb_private::Log::Channel
Definition: Log.h:60
POSIX_LOG_WATCHPOINTS
#define POSIX_LOG_WATCHPOINTS
Definition: ProcessPOSIXLog.h:22
POSIX_LOG_MEMORY
#define POSIX_LOG_MEMORY
Definition: ProcessPOSIXLog.h:18
POSIX_LOG_DEFAULT
#define POSIX_LOG_DEFAULT
Definition: ProcessPOSIXLog.h:24
lldb_private::ProcessPOSIXLog::g_channel
static Log::Channel g_channel
Definition: ProcessPOSIXLog.h:28
POSIX_LOG_BREAKPOINTS
#define POSIX_LOG_BREAKPOINTS
Definition: ProcessPOSIXLog.h:21
POSIX_LOG_PTRACE
#define POSIX_LOG_PTRACE
Definition: ProcessPOSIXLog.h:19
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16