1 //===-- Breakpoint.cpp ------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details->
8 //===----------------------------------------------------------------------===//
12 // Other libraries and framework includes
13 #include "llvm/Support/Casting.h"
16 #include "lldb/Breakpoint/Breakpoint.h"
17 #include "lldb/Breakpoint/BreakpointOptions.h"
18 #include "lldb/Breakpoint/BreakpointLocationCollection.h"
19 #include "lldb/Breakpoint/BreakpointResolver.h"
20 #include "lldb/Breakpoint/BreakpointResolverFileLine.h"
21 #include "lldb/Utility/Log.h"
22 #include "lldb/Utility/Stream.h"
23 #include "lldb/Utility/StreamString.h"
26 using namespace lldb_private;
28 const Flags::ValueType BreakpointName::Permissions::permissions_mask
29 [BreakpointName::Permissions::PermissionKinds::allPerms + 1] = {
36 BreakpointName::BreakpointName(const ConstString &name, const Breakpoint &bkpt,
38 m_name(name), m_options(bkpt.GetOptions())
43 bool BreakpointName::Permissions::GetDescription(Stream *s,
44 lldb::DescriptionLevel level) {
50 s->Printf("list: %s", GetAllowList() ? "allowed" : "disallowed");
52 if (IsSet(disablePerm))
53 s->Printf("disable: %s", GetAllowDisable() ? "allowed" : "disallowed");
55 if (IsSet(deletePerm))
56 s->Printf("delete: %s", GetAllowDelete() ? "allowed" : "disallowed");
61 bool BreakpointName::GetDescription(Stream *s, lldb::DescriptionLevel level) {
62 bool printed_any = false;
64 s->Printf("Help: %s\n", m_help.c_str());
66 if (GetOptions().AnySet())
68 s->PutCString("Options: \n");
71 GetOptions().GetDescription(s, level);
75 if (GetPermissions().AnySet())
77 s->PutCString("Permissions: \n");
80 GetPermissions().GetDescription(s, level);
87 void BreakpointName::ConfigureBreakpoint(lldb::BreakpointSP bp_sp)
89 bp_sp->GetOptions()->CopyOverSetOptions(GetOptions());
90 bp_sp->GetPermissions().MergeInto(GetPermissions());