summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/lldb/source/Breakpoint
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Breakpoint')
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/Breakpoint.cpp34
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/BreakpointID.cpp6
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/BreakpointIDList.cpp2
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/BreakpointList.cpp2
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocation.cpp8
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/BreakpointOptions.cpp18
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolver.cpp20
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverAddress.cpp8
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp101
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp10
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverName.cpp16
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSite.cpp2
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSiteList.cpp2
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/Watchpoint.cpp4
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/WatchpointOptions.cpp4
15 files changed, 150 insertions, 87 deletions
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/Breakpoint.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/Breakpoint.cpp
index 915756f..17c104ba0 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/Breakpoint.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/Breakpoint.cpp
@@ -19,18 +19,19 @@
#include "lldb/Breakpoint/BreakpointResolver.h"
#include "lldb/Breakpoint/BreakpointResolverFileLine.h"
#include "lldb/Core/Address.h"
-#include "lldb/Core/Log.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleList.h"
#include "lldb/Core/SearchFilter.h"
#include "lldb/Core/Section.h"
-#include "lldb/Core/Stream.h"
-#include "lldb/Core/StreamString.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/Function.h"
+#include "lldb/Symbol/Symbol.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/ThreadSpec.h"
+#include "lldb/Utility/Log.h"
+#include "lldb/Utility/Stream.h"
+#include "lldb/Utility/StreamString.h"
using namespace lldb;
using namespace lldb_private;
@@ -126,7 +127,7 @@ StructuredData::ObjectSP Breakpoint::SerializeToStructuredData() {
}
lldb::BreakpointSP Breakpoint::CreateFromStructuredData(
- Target &target, StructuredData::ObjectSP &object_data, Error &error) {
+ Target &target, StructuredData::ObjectSP &object_data, Status &error) {
BreakpointSP result_sp;
StructuredData::Dictionary *breakpoint_dict = object_data->GetAsDictionary();
@@ -145,7 +146,7 @@ lldb::BreakpointSP Breakpoint::CreateFromStructuredData(
return result_sp;
}
- Error create_error;
+ Status create_error;
BreakpointResolverSP resolver_sp =
BreakpointResolver::CreateFromStructuredData(*resolver_dict,
create_error);
@@ -206,10 +207,10 @@ lldb::BreakpointSP Breakpoint::CreateFromStructuredData(
if (success && names_array) {
size_t num_names = names_array->GetSize();
for (size_t i = 0; i < num_names; i++) {
- std::string name;
- Error error;
+ llvm::StringRef name;
+ Status error;
success = names_array->GetItemAtIndexAsString(i, name);
- result_sp->AddName(name.c_str(), error);
+ result_sp->AddName(name, error);
}
}
@@ -241,7 +242,7 @@ bool Breakpoint::SerializedBreakpointMatchesNames(
std::vector<std::string>::iterator end = names.end();
for (size_t i = 0; i < num_names; i++) {
- std::string name;
+ llvm::StringRef name;
if (names_array->GetItemAtIndexAsString(i, name)) {
if (std::find(begin, end, name) != end) {
return true;
@@ -832,12 +833,12 @@ size_t Breakpoint::GetNumResolvedLocations() const {
size_t Breakpoint::GetNumLocations() const { return m_locations.GetSize(); }
-bool Breakpoint::AddName(const char *new_name, Error &error) {
- if (!new_name)
+bool Breakpoint::AddName(llvm::StringRef new_name, Status &error) {
+ if (new_name.empty())
return false;
- if (!BreakpointID::StringIsBreakpointName(llvm::StringRef(new_name), error)) {
- error.SetErrorStringWithFormat("input name \"%s\" not a breakpoint name.",
- new_name);
+ if (!BreakpointID::StringIsBreakpointName(new_name, error)) {
+ error.SetErrorStringWithFormatv("input name \"{0}\" not a breakpoint name.",
+ new_name);
return false;
}
if (!error.Success())
@@ -996,8 +997,9 @@ bool Breakpoint::BreakpointPrecondition::EvaluatePrecondition(
void Breakpoint::BreakpointPrecondition::GetDescription(
Stream &stream, lldb::DescriptionLevel level) {}
-Error Breakpoint::BreakpointPrecondition::ConfigurePrecondition(Args &options) {
- Error error;
+Status
+Breakpoint::BreakpointPrecondition::ConfigurePrecondition(Args &options) {
+ Status error;
error.SetErrorString("Base breakpoint precondition has no options.");
return error;
}
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointID.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointID.cpp
index 1ea86ca..112f7c0 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointID.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointID.cpp
@@ -15,8 +15,8 @@
// Project includes
#include "lldb/Breakpoint/Breakpoint.h"
#include "lldb/Breakpoint/BreakpointID.h"
-#include "lldb/Core/Error.h"
-#include "lldb/Core/Stream.h"
+#include "lldb/Utility/Status.h"
+#include "lldb/Utility/Stream.h"
using namespace lldb;
using namespace lldb_private;
@@ -98,7 +98,7 @@ BreakpointID::ParseCanonicalReference(llvm::StringRef input) {
return BreakpointID(bp_id, loc_id);
}
-bool BreakpointID::StringIsBreakpointName(llvm::StringRef str, Error &error) {
+bool BreakpointID::StringIsBreakpointName(llvm::StringRef str, Status &error) {
error.Clear();
if (str.empty())
return false;
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointIDList.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointIDList.cpp
index 037b03e..7b46114 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointIDList.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointIDList.cpp
@@ -137,7 +137,7 @@ void BreakpointIDList::FindAndReplaceIDRanges(Args &old_args, Target *target,
}
llvm::StringRef range_expr;
- Error error;
+ Status error;
std::tie(range_from, range_to) =
BreakpointIDList::SplitIDRangeExpression(current_arg);
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointList.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointList.cpp
index 7f35588..15bcb34 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointList.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointList.cpp
@@ -139,7 +139,7 @@ BreakpointList::FindBreakpointByID(break_id_t break_id) const {
bool BreakpointList::FindBreakpointsByName(const char *name,
BreakpointList &matching_bps) {
- Error error;
+ Status error;
if (!name)
return false;
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocation.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocation.cpp
index 578267a..ec8f141 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocation.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocation.cpp
@@ -15,9 +15,7 @@
#include "lldb/Breakpoint/BreakpointID.h"
#include "lldb/Breakpoint/StoppointCallbackContext.h"
#include "lldb/Core/Debugger.h"
-#include "lldb/Core/Log.h"
#include "lldb/Core/Module.h"
-#include "lldb/Core/StreamString.h"
#include "lldb/Core/ValueObject.h"
#include "lldb/Expression/DiagnosticManager.h"
#include "lldb/Expression/ExpressionVariable.h"
@@ -29,6 +27,8 @@
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadSpec.h"
+#include "lldb/Utility/Log.h"
+#include "lldb/Utility/StreamString.h"
using namespace lldb;
using namespace lldb_private;
@@ -197,7 +197,7 @@ const char *BreakpointLocation::GetConditionText(size_t *hash) const {
}
bool BreakpointLocation::ConditionSaysStop(ExecutionContext &exe_ctx,
- Error &error) {
+ Status &error) {
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS);
std::lock_guard<std::mutex> guard(m_condition_mutex);
@@ -260,7 +260,7 @@ bool BreakpointLocation::ConditionSaysStop(ExecutionContext &exe_ctx,
options.SetResultIsInternal(
true); // Don't generate a user variable for condition expressions.
- Error expr_error;
+ Status expr_error;
diagnostics.Clear();
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointOptions.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointOptions.cpp
index 65c16e2..bef63cc 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointOptions.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointOptions.cpp
@@ -14,14 +14,14 @@
#include "lldb/Breakpoint/BreakpointOptions.h"
#include "lldb/Breakpoint/StoppointCallbackContext.h"
-#include "lldb/Core/Stream.h"
-#include "lldb/Core/StringList.h"
#include "lldb/Core/Value.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/ThreadSpec.h"
+#include "lldb/Utility/Stream.h"
+#include "lldb/Utility/StringList.h"
#include "llvm/ADT/STLExtras.h"
@@ -63,7 +63,7 @@ BreakpointOptions::CommandData::SerializeToStructuredData() {
std::unique_ptr<BreakpointOptions::CommandData>
BreakpointOptions::CommandData::CreateFromStructuredData(
- const StructuredData::Dictionary &options_dict, Error &error) {
+ const StructuredData::Dictionary &options_dict, Status &error) {
std::unique_ptr<CommandData> data_up(new CommandData());
bool found_something = false;
@@ -73,7 +73,7 @@ BreakpointOptions::CommandData::CreateFromStructuredData(
if (success)
found_something = true;
- std::string interpreter_str;
+ llvm::StringRef interpreter_str;
ScriptLanguage interp_language;
success = options_dict.GetValueForKeyAsString(
GetKey(OptionNames::Interpreter), interpreter_str);
@@ -99,7 +99,7 @@ BreakpointOptions::CommandData::CreateFromStructuredData(
found_something = true;
size_t num_elems = user_source->GetSize();
for (size_t i = 0; i < num_elems; i++) {
- std::string elem_string;
+ llvm::StringRef elem_string;
success = user_source->GetItemAtIndexAsString(i, elem_string);
if (success)
data_up->user_source.AppendString(elem_string);
@@ -196,7 +196,7 @@ BreakpointOptions::~BreakpointOptions() = default;
std::unique_ptr<BreakpointOptions> BreakpointOptions::CreateFromStructuredData(
Target &target, const StructuredData::Dictionary &options_dict,
- Error &error) {
+ Status &error) {
bool enabled = true;
bool one_shot = false;
int32_t ignore_count = 0;
@@ -230,7 +230,7 @@ std::unique_ptr<BreakpointOptions> BreakpointOptions::CreateFromStructuredData(
success = options_dict.GetValueForKeyAsDictionary(
CommandData::GetSerializationKey(), cmds_dict);
if (success && cmds_dict) {
- Error cmds_error;
+ Status cmds_error;
cmd_data_up = CommandData::CreateFromStructuredData(*cmds_dict, cmds_error);
if (cmds_error.Fail()) {
error.SetErrorStringWithFormat(
@@ -260,7 +260,7 @@ std::unique_ptr<BreakpointOptions> BreakpointOptions::CreateFromStructuredData(
.c_str());
return nullptr;
}
- Error script_error;
+ Status script_error;
script_error =
interp->SetBreakpointCommandCallback(bp_options.get(), cmd_data_up);
if (script_error.Fail()) {
@@ -275,7 +275,7 @@ std::unique_ptr<BreakpointOptions> BreakpointOptions::CreateFromStructuredData(
success = options_dict.GetValueForKeyAsDictionary(
ThreadSpec::GetSerializationKey(), thread_spec_dict);
if (success) {
- Error thread_spec_error;
+ Status thread_spec_error;
std::unique_ptr<ThreadSpec> thread_spec_up =
ThreadSpec::CreateFromStructuredData(*thread_spec_dict,
thread_spec_error);
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolver.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolver.cpp
index 27c663c..31aefb0 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolver.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolver.cpp
@@ -22,15 +22,15 @@
#include "lldb/Breakpoint/BreakpointResolverFileRegex.h"
#include "lldb/Breakpoint/BreakpointResolverName.h"
#include "lldb/Core/Address.h"
-#include "lldb/Core/Log.h"
#include "lldb/Core/ModuleList.h"
#include "lldb/Core/SearchFilter.h"
-#include "lldb/Core/Stream.h"
-#include "lldb/Core/StreamString.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Target/Target.h"
+#include "lldb/Utility/Log.h"
+#include "lldb/Utility/Stream.h"
+#include "lldb/Utility/StreamString.h"
using namespace lldb_private;
using namespace lldb;
@@ -56,9 +56,9 @@ const char *BreakpointResolver::ResolverTyToName(enum ResolverTy type) {
}
BreakpointResolver::ResolverTy
-BreakpointResolver::NameToResolverTy(const char *name) {
+BreakpointResolver::NameToResolverTy(llvm::StringRef name) {
for (size_t i = 0; i < LastKnownResolverType; i++) {
- if (strcmp(name, g_ty_to_name[i]) == 0)
+ if (name == g_ty_to_name[i])
return (ResolverTy)i;
}
return UnknownResolver;
@@ -72,14 +72,14 @@ BreakpointResolver::BreakpointResolver(Breakpoint *bkpt,
BreakpointResolver::~BreakpointResolver() {}
BreakpointResolverSP BreakpointResolver::CreateFromStructuredData(
- const StructuredData::Dictionary &resolver_dict, Error &error) {
+ const StructuredData::Dictionary &resolver_dict, Status &error) {
BreakpointResolverSP result_sp;
if (!resolver_dict.IsValid()) {
error.SetErrorString("Can't deserialize from an invalid data object.");
return result_sp;
}
- std::string subclass_name;
+ llvm::StringRef subclass_name;
bool success = resolver_dict.GetValueForKeyAsString(
GetSerializationSubclassKey(), subclass_name);
@@ -90,10 +90,10 @@ BreakpointResolverSP BreakpointResolver::CreateFromStructuredData(
return result_sp;
}
- ResolverTy resolver_type = NameToResolverTy(subclass_name.c_str());
+ ResolverTy resolver_type = NameToResolverTy(subclass_name);
if (resolver_type == UnknownResolver) {
- error.SetErrorStringWithFormat("Unknown resolver type: %s.",
- subclass_name.c_str());
+ error.SetErrorStringWithFormatv("Unknown resolver type: {0}.",
+ subclass_name);
return result_sp;
}
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverAddress.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverAddress.cpp
index 90d7415..32f2045 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverAddress.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverAddress.cpp
@@ -15,12 +15,12 @@
// Project includes
#include "lldb/Breakpoint/BreakpointLocation.h"
-#include "lldb/Core/Log.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/Section.h"
-#include "lldb/Core/StreamString.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
+#include "lldb/Utility/Log.h"
+#include "lldb/Utility/StreamString.h"
using namespace lldb;
using namespace lldb_private;
@@ -44,8 +44,8 @@ BreakpointResolverAddress::~BreakpointResolverAddress() {}
BreakpointResolver *BreakpointResolverAddress::CreateFromStructuredData(
Breakpoint *bkpt, const StructuredData::Dictionary &options_dict,
- Error &error) {
- std::string module_name;
+ Status &error) {
+ llvm::StringRef module_name;
lldb::addr_t addr_offset;
FileSpec module_filespec;
bool success;
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
index acdd297..780d25d 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
@@ -14,11 +14,11 @@
// Other libraries and framework includes
// Project includes
#include "lldb/Breakpoint/BreakpointLocation.h"
-#include "lldb/Core/Log.h"
#include "lldb/Core/Module.h"
-#include "lldb/Core/StreamString.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/Function.h"
+#include "lldb/Utility/Log.h"
+#include "lldb/Utility/StreamString.h"
using namespace lldb;
using namespace lldb_private;
@@ -38,8 +38,8 @@ BreakpointResolverFileLine::~BreakpointResolverFileLine() {}
BreakpointResolver *BreakpointResolverFileLine::CreateFromStructuredData(
Breakpoint *bkpt, const StructuredData::Dictionary &options_dict,
- Error &error) {
- std::string filename;
+ Status &error) {
+ llvm::StringRef filename;
uint32_t line_no;
bool check_inlines;
bool skip_prologue;
@@ -108,6 +108,68 @@ BreakpointResolverFileLine::SerializeToStructuredData() {
return WrapOptionsDict(options_dict_sp);
}
+// Filter the symbol context list to remove contexts where the line number was
+// moved into a new function. We do this conservatively, so if e.g. we cannot
+// resolve the function in the context (which can happen in case of
+// line-table-only debug info), we leave the context as is. The trickiest part
+// here is handling inlined functions -- in this case we need to make sure we
+// look at the declaration line of the inlined function, NOT the function it was
+// inlined into.
+void BreakpointResolverFileLine::FilterContexts(SymbolContextList &sc_list) {
+ if (m_exact_match)
+ return; // Nothing to do. Contexts are precise.
+
+ Log * log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS);
+ for(uint32_t i = 0; i < sc_list.GetSize(); ++i) {
+ SymbolContext sc;
+ sc_list.GetContextAtIndex(i, sc);
+ if (! sc.block)
+ continue;
+
+ FileSpec file;
+ uint32_t line;
+ const Block *inline_block = sc.block->GetContainingInlinedBlock();
+ if (inline_block) {
+ const Declaration &inline_declaration = inline_block->GetInlinedFunctionInfo()->GetDeclaration();
+ if (!inline_declaration.IsValid())
+ continue;
+ file = inline_declaration.GetFile();
+ line = inline_declaration.GetLine();
+ } else if (sc.function)
+ sc.function->GetStartLineSourceInfo(file, line);
+ else
+ continue;
+
+ if (file != sc.line_entry.file) {
+ LLDB_LOG(log, "unexpected symbol context file {0}", sc.line_entry.file);
+ continue;
+ }
+
+ // Compare the requested line number with the line of the function
+ // declaration. In case of a function declared as:
+ //
+ // int
+ // foo()
+ // {
+ // ...
+ //
+ // the compiler will set the declaration line to the "foo" line, which is
+ // the reason why we have -1 here. This can fail in case of two inline
+ // functions defined back-to-back:
+ //
+ // inline int foo1() { ... }
+ // inline int foo2() { ... }
+ //
+ // but that's the best we can do for now.
+ const int decl_line_is_too_late_fudge = 1;
+ if (m_line_number < line - decl_line_is_too_late_fudge) {
+ LLDB_LOG(log, "removing symbol context at {0}:{1}", file, line);
+ sc_list.RemoveContextAtIndex(i);
+ --i;
+ }
+ }
+}
+
Searcher::CallbackReturn
BreakpointResolverFileLine::SearchCallback(SearchFilter &filter,
SymbolContext &context,
@@ -117,24 +179,20 @@ BreakpointResolverFileLine::SearchCallback(SearchFilter &filter,
assert(m_breakpoint != NULL);
// There is a tricky bit here. You can have two compilation units that
- // #include the same file, and
- // in one of them the function at m_line_number is used (and so code and a
- // line entry for it is generated) but in the
- // other it isn't. If we considered the CU's independently, then in the
- // second inclusion, we'd move the breakpoint
- // to the next function that actually generated code in the header file. That
- // would end up being confusing.
- // So instead, we do the CU iterations by hand here, then scan through the
- // complete list of matches, and figure out
- // the closest line number match, and only set breakpoints on that match.
+ // #include the same file, and in one of them the function at m_line_number is
+ // used (and so code and a line entry for it is generated) but in the other it
+ // isn't. If we considered the CU's independently, then in the second
+ // inclusion, we'd move the breakpoint to the next function that actually
+ // generated code in the header file. That would end up being confusing. So
+ // instead, we do the CU iterations by hand here, then scan through the
+ // complete list of matches, and figure out the closest line number match, and
+ // only set breakpoints on that match.
// Note also that if file_spec only had a file name and not a directory, there
- // may be many different file spec's in
- // the resultant list. The closest line match for one will not be right for
- // some totally different file.
- // So we go through the match list and pull out the sets that have the same
- // file spec in their line_entry
- // and treat each set separately.
+ // may be many different file spec's in the resultant list. The closest line
+ // match for one will not be right for some totally different file. So we go
+ // through the match list and pull out the sets that have the same file spec
+ // in their line_entry and treat each set separately.
const size_t num_comp_units = context.module_sp->GetNumCompileUnits();
for (size_t i = 0; i < num_comp_units; i++) {
@@ -146,6 +204,9 @@ BreakpointResolverFileLine::SearchCallback(SearchFilter &filter,
sc_list);
}
}
+
+ FilterContexts(sc_list);
+
StreamString s;
s.Printf("for %s:%d ", m_file_spec.GetFilename().AsCString("<Unknown>"),
m_line_number);
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp
index 8655296..54c05a0 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp
@@ -14,11 +14,11 @@
// Other libraries and framework includes
// Project includes
#include "lldb/Breakpoint/BreakpointLocation.h"
-#include "lldb/Core/Log.h"
#include "lldb/Core/SourceManager.h"
-#include "lldb/Core/StreamString.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Target/Target.h"
+#include "lldb/Utility/Log.h"
+#include "lldb/Utility/StreamString.h"
using namespace lldb;
using namespace lldb_private;
@@ -37,10 +37,10 @@ BreakpointResolverFileRegex::~BreakpointResolverFileRegex() {}
BreakpointResolver *BreakpointResolverFileRegex::CreateFromStructuredData(
Breakpoint *bkpt, const StructuredData::Dictionary &options_dict,
- Error &error) {
+ Status &error) {
bool success;
- std::string regex_string;
+ llvm::StringRef regex_string;
success = options_dict.GetValueForKeyAsString(
GetKey(OptionNames::RegexString), regex_string);
if (!success) {
@@ -65,7 +65,7 @@ BreakpointResolver *BreakpointResolverFileRegex::CreateFromStructuredData(
if (success && names_array) {
size_t num_names = names_array->GetSize();
for (size_t i = 0; i < num_names; i++) {
- std::string name;
+ llvm::StringRef name;
success = names_array->GetItemAtIndexAsString(i, name);
if (!success) {
error.SetErrorStringWithFormat(
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverName.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverName.cpp
index 6cc8f60..468de35 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverName.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverName.cpp
@@ -16,13 +16,13 @@
#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
#include "Plugins/Language/ObjC/ObjCLanguage.h"
#include "lldb/Breakpoint/BreakpointLocation.h"
-#include "lldb/Core/Log.h"
#include "lldb/Core/Module.h"
-#include "lldb/Core/StreamString.h"
#include "lldb/Symbol/Block.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Symbol/SymbolContext.h"
+#include "lldb/Utility/Log.h"
+#include "lldb/Utility/StreamString.h"
using namespace lldb;
using namespace lldb_private;
@@ -92,16 +92,16 @@ BreakpointResolverName::BreakpointResolverName(
BreakpointResolver *BreakpointResolverName::CreateFromStructuredData(
Breakpoint *bkpt, const StructuredData::Dictionary &options_dict,
- Error &error) {
+ Status &error) {
LanguageType language = eLanguageTypeUnknown;
- std::string language_name;
+ llvm::StringRef language_name;
bool success = options_dict.GetValueForKeyAsString(
GetKey(OptionNames::LanguageName), language_name);
if (success) {
language = Language::GetLanguageTypeFromString(language_name);
if (language == eLanguageTypeUnknown) {
- error.SetErrorStringWithFormat("BRN::CFSD: Unknown language: %s.",
- language_name.c_str());
+ error.SetErrorStringWithFormatv("BRN::CFSD: Unknown language: {0}.",
+ language_name);
return nullptr;
}
}
@@ -122,7 +122,7 @@ BreakpointResolver *BreakpointResolverName::CreateFromStructuredData(
return nullptr;
}
- std::string regex_text;
+ llvm::StringRef regex_text;
success = options_dict.GetValueForKeyAsString(
GetKey(OptionNames::RegexString), regex_text);
if (success) {
@@ -162,7 +162,7 @@ BreakpointResolver *BreakpointResolverName::CreateFromStructuredData(
std::vector<uint32_t> name_masks;
for (size_t i = 0; i < num_elem; i++) {
uint32_t name_mask;
- std::string name;
+ llvm::StringRef name;
success = names_array->GetItemAtIndexAsString(i, name);
if (!success) {
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSite.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSite.cpp
index 28ba37b..a5c5136 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSite.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSite.cpp
@@ -18,7 +18,7 @@
#include "lldb/Breakpoint/Breakpoint.h"
#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Breakpoint/BreakpointSiteList.h"
-#include "lldb/Core/Stream.h"
+#include "lldb/Utility/Stream.h"
using namespace lldb;
using namespace lldb_private;
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSiteList.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSiteList.cpp
index 06155ee..87ce292 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSiteList.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSiteList.cpp
@@ -13,7 +13,7 @@
// C++ Includes
// Other libraries and framework includes
// Project includes
-#include "lldb/Core/Stream.h"
+#include "lldb/Utility/Stream.h"
#include <algorithm>
using namespace lldb;
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/Watchpoint.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/Watchpoint.cpp
index 13dba8c..a141a6b 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/Watchpoint.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/Watchpoint.cpp
@@ -14,7 +14,6 @@
#include "lldb/Breakpoint/Watchpoint.h"
#include "lldb/Breakpoint/StoppointCallbackContext.h"
-#include "lldb/Core/Stream.h"
#include "lldb/Core/Value.h"
#include "lldb/Core/ValueObject.h"
#include "lldb/Core/ValueObjectMemory.h"
@@ -23,6 +22,7 @@
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/ThreadSpec.h"
+#include "lldb/Utility/Stream.h"
using namespace lldb;
using namespace lldb_private;
@@ -286,7 +286,7 @@ void Watchpoint::SetCondition(const char *condition) {
m_condition_ap.reset();
} else {
// Pass nullptr for expr_prefix (no translation-unit level definitions).
- Error error;
+ Status error;
m_condition_ap.reset(m_target.GetUserExpressionForLanguage(
condition, llvm::StringRef(), lldb::eLanguageTypeUnknown,
UserExpression::eResultTypeAny, EvaluateExpressionOptions(), error));
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/WatchpointOptions.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/WatchpointOptions.cpp
index 311dcaa..558ebc5 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/WatchpointOptions.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/WatchpointOptions.cpp
@@ -14,12 +14,12 @@
#include "lldb/Breakpoint/WatchpointOptions.h"
#include "lldb/Breakpoint/StoppointCallbackContext.h"
-#include "lldb/Core/Stream.h"
-#include "lldb/Core/StringList.h"
#include "lldb/Core/Value.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/ThreadSpec.h"
+#include "lldb/Utility/Stream.h"
+#include "lldb/Utility/StringList.h"
using namespace lldb;
using namespace lldb_private;
OpenPOWER on IntegriCloud