diff options
Diffstat (limited to 'source/Breakpoint/Breakpoint.cpp')
-rw-r--r-- | source/Breakpoint/Breakpoint.cpp | 47 |
1 files changed, 13 insertions, 34 deletions
diff --git a/source/Breakpoint/Breakpoint.cpp b/source/Breakpoint/Breakpoint.cpp index 131d2a707d447..3c3841949b91d 100644 --- a/source/Breakpoint/Breakpoint.cpp +++ b/source/Breakpoint/Breakpoint.cpp @@ -1,9 +1,8 @@ //===-- Breakpoint.cpp ------------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -12,6 +11,7 @@ #include "lldb/Breakpoint/Breakpoint.h" #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Breakpoint/BreakpointLocationCollection.h" +#include "lldb/Breakpoint/BreakpointPrecondition.h" #include "lldb/Breakpoint/BreakpointResolver.h" #include "lldb/Breakpoint/BreakpointResolverFileLine.h" #include "lldb/Core/Address.h" @@ -30,11 +30,13 @@ #include "lldb/Utility/Stream.h" #include "lldb/Utility/StreamString.h" +#include <memory> + using namespace lldb; using namespace lldb_private; using namespace llvm; -const ConstString &Breakpoint::GetEventIdentifier() { +ConstString Breakpoint::GetEventIdentifier() { static ConstString g_identifier("event-identifier.breakpoint.changed"); return g_identifier; } @@ -42,9 +44,7 @@ const ConstString &Breakpoint::GetEventIdentifier() { const char *Breakpoint::g_option_names[static_cast<uint32_t>( Breakpoint::OptionNames::LastOptionName)]{"Names", "Hardware"}; -//---------------------------------------------------------------------- // Breakpoint constructor -//---------------------------------------------------------------------- Breakpoint::Breakpoint(Target &target, SearchFilterSP &filter_sp, BreakpointResolverSP &resolver_sp, bool hardware, bool resolve_indirect_symbols) @@ -58,7 +58,7 @@ Breakpoint::Breakpoint(Target &target, SearchFilterSP &filter_sp, Breakpoint::Breakpoint(Target &new_target, Breakpoint &source_bp) : m_being_created(true), m_hardware(source_bp.m_hardware), m_target(new_target), m_name_list(source_bp.m_name_list), - m_options_up(new BreakpointOptions(*source_bp.m_options_up.get())), + m_options_up(new BreakpointOptions(*source_bp.m_options_up)), m_locations(*this), m_resolve_indirect_symbols(source_bp.m_resolve_indirect_symbols), m_hit_count(0) { @@ -67,14 +67,10 @@ Breakpoint::Breakpoint(Target &new_target, Breakpoint &source_bp) m_filter_sp = source_bp.m_filter_sp->CopyForBreakpoint(*this); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- Breakpoint::~Breakpoint() = default; -//---------------------------------------------------------------------- // Serialization -//---------------------------------------------------------------------- StructuredData::ObjectSP Breakpoint::SerializeToStructuredData() { // Serialize the resolver: StructuredData::DictionarySP breakpoint_dict_sp( @@ -159,8 +155,8 @@ lldb::BreakpointSP Breakpoint::CreateFromStructuredData( SearchFilter::GetSerializationKey(), filter_dict); SearchFilterSP filter_sp; if (!success) - filter_sp.reset( - new SearchFilterForUnconstrainedSearches(target.shared_from_this())); + filter_sp = std::make_shared<SearchFilterForUnconstrainedSearches>( + target.shared_from_this()); else { filter_sp = SearchFilter::CreateFromStructuredData(target, *filter_dict, create_error); @@ -495,9 +491,7 @@ void Breakpoint::ClearAllBreakpointSites() { m_locations.ClearAllBreakpointSites(); } -//---------------------------------------------------------------------- // ModulesChanged: Pass in a list of new modules, and -//---------------------------------------------------------------------- void Breakpoint::ModulesChanged(ModuleList &module_list, bool load, bool delete_locations) { @@ -971,7 +965,7 @@ void Breakpoint::GetResolverDescription(Stream *s) { m_resolver_sp->GetDescription(s); } -bool Breakpoint::GetMatchingFileLine(const ConstString &filename, +bool Breakpoint::GetMatchingFileLine(ConstString filename, uint32_t line_number, BreakpointLocationCollection &loc_coll) { // TODO: To be correct, this method needs to fill the breakpoint location @@ -1002,21 +996,6 @@ bool Breakpoint::EvaluatePrecondition(StoppointCallbackContext &context) { return m_precondition_sp->EvaluatePrecondition(context); } -bool Breakpoint::BreakpointPrecondition::EvaluatePrecondition( - StoppointCallbackContext &context) { - return true; -} - -void Breakpoint::BreakpointPrecondition::GetDescription( - Stream &stream, lldb::DescriptionLevel level) {} - -Status -Breakpoint::BreakpointPrecondition::ConfigurePrecondition(Args &options) { - Status error; - error.SetErrorString("Base breakpoint precondition has no options."); - return error; -} - void Breakpoint::SendBreakpointChangedEvent( lldb::BreakpointEventType eventKind) { if (!m_being_created && !IsInternal() && @@ -1047,12 +1026,12 @@ Breakpoint::BreakpointEventData::BreakpointEventData( Breakpoint::BreakpointEventData::~BreakpointEventData() = default; -const ConstString &Breakpoint::BreakpointEventData::GetFlavorString() { +ConstString Breakpoint::BreakpointEventData::GetFlavorString() { static ConstString g_flavor("Breakpoint::BreakpointEventData"); return g_flavor; } -const ConstString &Breakpoint::BreakpointEventData::GetFlavor() const { +ConstString Breakpoint::BreakpointEventData::GetFlavor() const { return BreakpointEventData::GetFlavorString(); } |