blob: 8f16b83907cf6df6405614d52405d2d98808ff44 [file] [log] [blame]
Chris Lattner30fdc8d2010-06-08 16:52:24 +00001//===-- ProcessGDBRemoteLog.cpp ---------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "ProcessGDBRemoteLog.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000011#include "ProcessGDBRemote.h"
Pavel Labath39addef2017-02-17 16:09:06 +000012#include "llvm/Support/Threading.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000013
14using namespace lldb;
15using namespace lldb_private;
Tamas Berghammerdb264a62015-03-31 09:52:22 +000016using namespace lldb_private::process_gdb_remote;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000017
Pavel Labath39addef2017-02-17 16:09:06 +000018static constexpr Log::Category g_categories[] = {
19 {{"async"}, {"log asynchronous activity"}, GDBR_LOG_ASYNC},
20 {{"break"}, {"log breakpoints"}, GDBR_LOG_BREAKPOINTS},
21 {{"comm"}, {"log communication activity"}, GDBR_LOG_COMM},
22 {{"packets"}, {"log gdb remote packets"}, GDBR_LOG_PACKETS},
23 {{"memory"}, {"log memory reads and writes"}, GDBR_LOG_MEMORY},
24 {{"data-short"},
25 {"log memory bytes for memory reads and writes for short transactions "
26 "only"},
27 GDBR_LOG_MEMORY_DATA_SHORT},
28 {{"data-long"},
29 {"log memory bytes for memory reads and writes for all transactions"},
30 GDBR_LOG_MEMORY_DATA_LONG},
31 {{"process"}, {"log process events and activities"}, GDBR_LOG_PROCESS},
32 {{"step"}, {"log step related activities"}, GDBR_LOG_STEP},
33 {{"thread"}, {"log thread events and activities"}, GDBR_LOG_THREAD},
34 {{"watch"}, {"log watchpoint related activities"}, GDBR_LOG_WATCHPOINTS},
35};
36
37Log::Channel ProcessGDBRemoteLog::g_channel(g_categories, GDBR_LOG_DEFAULT);
Greg Clayton2687cd12012-03-29 01:55:41 +000038
Kate Stoneb9c1b512016-09-06 20:57:50 +000039void ProcessGDBRemoteLog::Initialize() {
Kamil Rytarowskic5f28e22017-02-06 17:55:02 +000040 static llvm::once_flag g_once_flag;
Kamil Rytarowskic5f28e22017-02-06 17:55:02 +000041 llvm::call_once(g_once_flag, []() {
Pavel Labath39addef2017-02-17 16:09:06 +000042 Log::Register("gdb-remote", g_channel);
Kate Stoneb9c1b512016-09-06 20:57:50 +000043 });
Caroline Tice20ad3c42010-10-29 21:48:37 +000044}