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 //===----------------------------------------------------------------------===//
10 #include "llvm/Support/Casting.h"
12 #include "lldb/Breakpoint/Breakpoint.h"
13 #include "lldb/Breakpoint/BreakpointOptions.h"
14 #include "lldb/Breakpoint/BreakpointLocationCollection.h"
15 #include "lldb/Breakpoint/BreakpointResolver.h"
16 #include "lldb/Breakpoint/BreakpointResolverFileLine.h"
17 #include "lldb/Utility/Log.h"
18 #include "lldb/Utility/Stream.h"
19 #include "lldb/Utility/StreamString.h"
22 using namespace lldb_private;
24 const Flags::ValueType BreakpointName::Permissions::permissions_mask
25 [BreakpointName::Permissions::PermissionKinds::allPerms + 1] = {
32 BreakpointName::BreakpointName(const ConstString &name, const Breakpoint &bkpt,
34 m_name(name), m_options(bkpt.GetOptions())
39 bool BreakpointName::Permissions::GetDescription(Stream *s,
40 lldb::DescriptionLevel level) {
46 s->Printf("list: %s", GetAllowList() ? "allowed" : "disallowed");
48 if (IsSet(disablePerm))
49 s->Printf("disable: %s", GetAllowDisable() ? "allowed" : "disallowed");
51 if (IsSet(deletePerm))
52 s->Printf("delete: %s", GetAllowDelete() ? "allowed" : "disallowed");
57 bool BreakpointName::GetDescription(Stream *s, lldb::DescriptionLevel level) {
58 bool printed_any = false;
60 s->Printf("Help: %s\n", m_help.c_str());
62 if (GetOptions().AnySet())
64 s->PutCString("Options: \n");
67 GetOptions().GetDescription(s, level);
71 if (GetPermissions().AnySet())
73 s->PutCString("Permissions: \n");
76 GetPermissions().GetDescription(s, level);
83 void BreakpointName::ConfigureBreakpoint(lldb::BreakpointSP bp_sp)
85 bp_sp->GetOptions()->CopyOverSetOptions(GetOptions());
86 bp_sp->GetPermissions().MergeInto(GetPermissions());