Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 1 | //===-- 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 Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 11 | #include "ProcessGDBRemote.h" |
Pavel Labath | 39addef | 2017-02-17 16:09:06 +0000 | [diff] [blame] | 12 | #include "llvm/Support/Threading.h" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 13 | |
| 14 | using namespace lldb; |
| 15 | using namespace lldb_private; |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 16 | using namespace lldb_private::process_gdb_remote; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 17 | |
Pavel Labath | 39addef | 2017-02-17 16:09:06 +0000 | [diff] [blame] | 18 | static 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 | |
| 37 | Log::Channel ProcessGDBRemoteLog::g_channel(g_categories, GDBR_LOG_DEFAULT); |
Greg Clayton | 2687cd1 | 2012-03-29 01:55:41 +0000 | [diff] [blame] | 38 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 39 | void ProcessGDBRemoteLog::Initialize() { |
Kamil Rytarowski | c5f28e2 | 2017-02-06 17:55:02 +0000 | [diff] [blame] | 40 | static llvm::once_flag g_once_flag; |
Kamil Rytarowski | c5f28e2 | 2017-02-06 17:55:02 +0000 | [diff] [blame] | 41 | llvm::call_once(g_once_flag, []() { |
Pavel Labath | 39addef | 2017-02-17 16:09:06 +0000 | [diff] [blame] | 42 | Log::Register("gdb-remote", g_channel); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 43 | }); |
Caroline Tice | 20ad3c4 | 2010-10-29 21:48:37 +0000 | [diff] [blame] | 44 | } |