1254721Semaste//===-- ProcessGDBRemoteLog.h -----------------------------------*- C++ -*-===//
2254721Semaste//
3254721Semaste//                     The LLVM Compiler Infrastructure
4254721Semaste//
5254721Semaste// This file is distributed under the University of Illinois Open Source
6254721Semaste// License. See LICENSE.TXT for details.
7254721Semaste//
8254721Semaste//===----------------------------------------------------------------------===//
9254721Semaste
10254721Semaste#ifndef liblldb_ProcessGDBRemoteLog_h_
11254721Semaste#define liblldb_ProcessGDBRemoteLog_h_
12254721Semaste
13254721Semaste// C Includes
14254721Semaste// C++ Includes
15254721Semaste// Other libraries and framework includes
16254721Semaste
17254721Semaste// Project includes
18254721Semaste#include "lldb/Core/Log.h"
19254721Semaste
20254721Semaste#define GDBR_LOG_VERBOSE                  (1u << 0)
21254721Semaste#define GDBR_LOG_PROCESS                  (1u << 1)
22254721Semaste#define GDBR_LOG_THREAD                   (1u << 2)
23254721Semaste#define GDBR_LOG_PACKETS                  (1u << 3)
24254721Semaste#define GDBR_LOG_MEMORY                   (1u << 4)    // Log memory reads/writes calls
25254721Semaste#define GDBR_LOG_MEMORY_DATA_SHORT        (1u << 5)    // Log short memory reads/writes bytes
26254721Semaste#define GDBR_LOG_MEMORY_DATA_LONG         (1u << 6)    // Log all memory reads/writes bytes
27254721Semaste#define GDBR_LOG_BREAKPOINTS              (1u << 7)
28254721Semaste#define GDBR_LOG_WATCHPOINTS              (1u << 8)
29254721Semaste#define GDBR_LOG_STEP                     (1u << 9)
30254721Semaste#define GDBR_LOG_COMM                     (1u << 10)
31254721Semaste#define GDBR_LOG_ASYNC                    (1u << 11)
32254721Semaste#define GDBR_LOG_ALL                      (UINT32_MAX)
33254721Semaste#define GDBR_LOG_DEFAULT                  GDBR_LOG_PACKETS
34254721Semaste
35288943Sdimnamespace lldb_private {
36288943Sdimnamespace process_gdb_remote {
37288943Sdim
38254721Semasteclass ProcessGDBRemoteLog
39254721Semaste{
40254721Semastepublic:
41288943Sdim    static void
42288943Sdim    Initialize();
43288943Sdim
44288943Sdim    static Log *
45254721Semaste    GetLogIfAllCategoriesSet(uint32_t mask = 0);
46254721Semaste
47288943Sdim    static Log *
48254721Semaste    GetLogIfAnyCategoryIsSet (uint32_t mask);
49254721Semaste
50254721Semaste    static void
51288943Sdim    DisableLog (const char **categories, Stream *feedback_strm);
52254721Semaste
53288943Sdim    static Log *
54288943Sdim    EnableLog (lldb::StreamSP &log_stream_sp, uint32_t log_options, const char **categories, Stream *feedback_strm);
55254721Semaste
56254721Semaste    static void
57288943Sdim    ListLogCategories (Stream *strm);
58254721Semaste
59254721Semaste    static void
60254721Semaste    LogIf (uint32_t mask, const char *format, ...);
61254721Semaste};
62254721Semaste
63288943Sdim} // namespace process_gdb_remote
64288943Sdim} // namespace lldb_private
65288943Sdim
66254721Semaste#endif  // liblldb_ProcessGDBRemoteLog_h_
67