LLDB mainline
BreakpointName.cpp
Go to the documentation of this file.
1//===-- BreakpointName.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 "llvm/Support/Casting.h"
10
16#include "lldb/Utility/Log.h"
17#include "lldb/Utility/Stream.h"
19
20using namespace lldb;
21using namespace lldb_private;
22
25 (1u << 0), (1u << 1), (1u << 2), (0x5u)};
26
29 if (!AnySet())
30 return false;
31 s->IndentMore();
32 s->Indent();
33 if (IsSet(listPerm))
34 s->Printf("list: %s", GetAllowList() ? "allowed" : "disallowed");
35
36 if (IsSet(disablePerm))
37 s->Printf("disable: %s", GetAllowDisable() ? "allowed" : "disallowed");
38
39 if (IsSet(deletePerm))
40 s->Printf("delete: %s", GetAllowDelete() ? "allowed" : "disallowed");
41 s->IndentLess();
42 return true;
43}
44
46 bool printed_any = false;
47 if (!m_help.empty())
48 s->Printf("Help: %s\n", m_help.c_str());
49
50 if (GetOptions().AnySet())
51 {
52 s->PutCString("Options: \n");
53 s->IndentMore();
54 s->Indent();
55 GetOptions().GetDescription(s, level);
56 printed_any = true;
57 s->IndentLess();
58 }
59 if (GetPermissions().AnySet())
60 {
61 s->PutCString("Permissions: \n");
62 s->IndentMore();
63 s->Indent();
65 printed_any = true;
66 s->IndentLess();
67 }
68 return printed_any;
69}
70
72{
73 bp_sp->GetOptions().CopyOverSetOptions(GetOptions());
74 bp_sp->GetPermissions().MergeInto(GetPermissions());
75}
bool IsSet(enum PermissionKinds permission) const
bool GetDescription(Stream *s, lldb::DescriptionLevel level)
static const Flags::ValueType permissions_mask[allPerms+1]
bool GetDescription(Stream *s, lldb::DescriptionLevel level)
BreakpointOptions & GetOptions()
void ConfigureBreakpoint(lldb::BreakpointSP bp_sp)
void GetDescription(Stream *s, lldb::DescriptionLevel level) const
uint32_t ValueType
The value type for flags is a 32 bit unsigned integer type.
Definition Flags.h:25
A stream class that can stream formatted output to a file.
Definition Stream.h:28
size_t Indent(llvm::StringRef s="")
Indent the current line in the stream.
Definition Stream.cpp:157
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition Stream.cpp:134
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition Stream.cpp:65
void IndentLess(unsigned amount=2)
Decrement the current indentation level.
Definition Stream.cpp:198
void IndentMore(unsigned amount=2)
Increment the current indentation level.
Definition Stream.cpp:195
A class that represents a running process on the host machine.
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP