[lldb][NFC] Fix all formatting errors in .cpp file headers
Summary:
A *.cpp file header in LLDB (and in LLDB) should like this:
```
//===-- TestUtilities.cpp -------------------------------------------------===//
```
However in LLDB most of our source files have arbitrary changes to this format and
these changes are spreading through LLDB as folks usually just use the existing
source files as templates for their new files (most notably the unnecessary
editor language indicator `-*- C++ -*-` is spreading and in every review
someone is pointing out that this is wrong, resulting in people pointing out that this
is done in the same way in other files).
This patch removes most of these inconsistencies including the editor language indicators,
all the different missing/additional '-' characters, files that center the file name, missing
trailing `===//` (mostly caused by clang-format breaking the line).
Reviewers: aprantl, espindola, jfb, shafik, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: dexonsmith, wuzish, emaste, sdardis, nemanjai, kbarton, MaskRay, atanasyan, arphaman, jfb, abidh, jsji, JDevlieghere, usaxena95, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D73258
2020-01-24 15:23:27 +08:00
|
|
|
//===-- BreakpointIDList.cpp ----------------------------------------------===//
|
2010-06-09 00:52:24 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// 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
|
2010-06-09 00:52:24 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2017-09-15 04:22:49 +08:00
|
|
|
#include "lldb/lldb-enumerations.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/Breakpoint/BreakpointIDList.h"
|
|
|
|
|
|
|
|
#include "lldb/Breakpoint/Breakpoint.h"
|
|
|
|
#include "lldb/Breakpoint/BreakpointLocation.h"
|
|
|
|
#include "lldb/Interpreter/CommandReturnObject.h"
|
|
|
|
#include "lldb/Target/Target.h"
|
2018-04-18 02:53:35 +08:00
|
|
|
#include "lldb/Utility/Args.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
using namespace lldb;
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
|
|
|
// class BreakpointIDList
|
|
|
|
|
|
|
|
BreakpointIDList::BreakpointIDList()
|
|
|
|
: m_invalid_id(LLDB_INVALID_BREAK_ID, LLDB_INVALID_BREAK_ID) {}
|
|
|
|
|
2015-10-31 02:50:12 +08:00
|
|
|
BreakpointIDList::~BreakpointIDList() = default;
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2016-09-15 03:05:27 +08:00
|
|
|
size_t BreakpointIDList::GetSize() const { return m_breakpoint_ids.size(); }
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2016-09-15 03:05:27 +08:00
|
|
|
const BreakpointID &
|
|
|
|
BreakpointIDList::GetBreakpointIDAtIndex(size_t index) const {
|
2015-10-31 02:50:12 +08:00
|
|
|
return ((index < m_breakpoint_ids.size()) ? m_breakpoint_ids[index]
|
|
|
|
: m_invalid_id);
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
2013-01-26 02:06:21 +08:00
|
|
|
bool BreakpointIDList::RemoveBreakpointIDAtIndex(size_t index) {
|
2010-07-10 04:39:50 +08:00
|
|
|
if (index >= m_breakpoint_ids.size())
|
|
|
|
return false;
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2010-07-10 04:39:50 +08:00
|
|
|
m_breakpoint_ids.erase(m_breakpoint_ids.begin() + index);
|
|
|
|
return true;
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void BreakpointIDList::Clear() { m_breakpoint_ids.clear(); }
|
|
|
|
|
|
|
|
bool BreakpointIDList::AddBreakpointID(BreakpointID bp_id) {
|
|
|
|
m_breakpoint_ids.push_back(bp_id);
|
|
|
|
|
|
|
|
return true; // We don't do any verification in this function, so always
|
|
|
|
// return true.
|
|
|
|
}
|
|
|
|
|
|
|
|
bool BreakpointIDList::AddBreakpointID(const char *bp_id_str) {
|
2016-10-06 01:07:47 +08:00
|
|
|
auto bp_id = BreakpointID::ParseCanonicalReference(bp_id_str);
|
|
|
|
if (!bp_id.hasValue())
|
|
|
|
return false;
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2016-10-06 01:07:47 +08:00
|
|
|
m_breakpoint_ids.push_back(*bp_id);
|
|
|
|
return true;
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
2016-09-15 03:05:27 +08:00
|
|
|
bool BreakpointIDList::FindBreakpointID(BreakpointID &bp_id,
|
|
|
|
size_t *position) const {
|
2010-07-10 04:39:50 +08:00
|
|
|
for (size_t i = 0; i < m_breakpoint_ids.size(); ++i) {
|
2010-06-09 00:52:24 +08:00
|
|
|
BreakpointID tmp_id = m_breakpoint_ids[i];
|
|
|
|
if (tmp_id.GetBreakpointID() == bp_id.GetBreakpointID() &&
|
|
|
|
tmp_id.GetLocationID() == bp_id.GetLocationID()) {
|
|
|
|
*position = i;
|
|
|
|
return true;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
return false;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2013-01-26 02:06:21 +08:00
|
|
|
bool BreakpointIDList::FindBreakpointID(const char *bp_id_str,
|
2016-09-15 03:05:27 +08:00
|
|
|
size_t *position) const {
|
2016-10-06 01:07:47 +08:00
|
|
|
auto bp_id = BreakpointID::ParseCanonicalReference(bp_id_str);
|
|
|
|
if (!bp_id.hasValue())
|
2010-06-09 00:52:24 +08:00
|
|
|
return false;
|
2016-10-06 01:07:47 +08:00
|
|
|
|
|
|
|
return FindBreakpointID(*bp_id, position);
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
2018-06-20 16:12:50 +08:00
|
|
|
void BreakpointIDList::InsertStringArray(
|
|
|
|
llvm::ArrayRef<const char *> string_array, CommandReturnObject &result) {
|
|
|
|
if(string_array.empty())
|
2010-06-09 00:52:24 +08:00
|
|
|
return;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2018-06-20 16:12:50 +08:00
|
|
|
for (const char *str : string_array) {
|
|
|
|
auto bp_id = BreakpointID::ParseCanonicalReference(str);
|
2016-10-06 02:40:51 +08:00
|
|
|
if (bp_id.hasValue())
|
2016-10-06 01:07:47 +08:00
|
|
|
m_breakpoint_ids.push_back(*bp_id);
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
result.SetStatus(eReturnStatusSuccessFinishNoResult);
|
|
|
|
}
|
|
|
|
|
|
|
|
// This function takes OLD_ARGS, which is usually the result of breaking the
|
|
|
|
// command string arguments into
|
|
|
|
// an array of space-separated strings, and searches through the arguments for
|
|
|
|
// any breakpoint ID range specifiers.
|
|
|
|
// Any string in the array that is not part of an ID range specifier is copied
|
|
|
|
// directly into NEW_ARGS. If any
|
|
|
|
// ID range specifiers are found, the range is interpreted and a list of
|
|
|
|
// canonical breakpoint IDs corresponding to
|
|
|
|
// all the current breakpoints and locations in the range are added to
|
|
|
|
// NEW_ARGS. When this function is done,
|
|
|
|
// NEW_ARGS should be a copy of OLD_ARGS, with and ID range specifiers replaced
|
|
|
|
// by the members of the range.
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2014-12-17 07:40:14 +08:00
|
|
|
void BreakpointIDList::FindAndReplaceIDRanges(Args &old_args, Target *target,
|
|
|
|
bool allow_locations,
|
2017-09-15 04:22:49 +08:00
|
|
|
BreakpointName::Permissions
|
|
|
|
::PermissionKinds purpose,
|
2014-12-17 07:40:14 +08:00
|
|
|
CommandReturnObject &result,
|
2010-06-09 00:52:24 +08:00
|
|
|
Args &new_args) {
|
2016-10-06 01:07:47 +08:00
|
|
|
llvm::StringRef range_from;
|
|
|
|
llvm::StringRef range_to;
|
|
|
|
llvm::StringRef current_arg;
|
2014-12-17 07:40:14 +08:00
|
|
|
std::set<std::string> names_found;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2016-11-23 01:10:15 +08:00
|
|
|
for (size_t i = 0; i < old_args.size(); ++i) {
|
2010-06-09 00:52:24 +08:00
|
|
|
bool is_range = false;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2019-09-13 19:26:48 +08:00
|
|
|
current_arg = old_args[i].ref();
|
2016-10-06 01:07:47 +08:00
|
|
|
if (!allow_locations && current_arg.contains('.')) {
|
2010-06-09 00:52:24 +08:00
|
|
|
result.AppendErrorWithFormat(
|
2016-10-06 01:07:47 +08:00
|
|
|
"Breakpoint locations not allowed, saw location: %s.",
|
|
|
|
current_arg.str().c_str());
|
2014-12-17 07:40:14 +08:00
|
|
|
new_args.Clear();
|
2016-09-07 04:57:50 +08:00
|
|
|
return;
|
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2017-05-12 12:51:55 +08:00
|
|
|
Status error;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2016-10-06 01:07:47 +08:00
|
|
|
std::tie(range_from, range_to) =
|
|
|
|
BreakpointIDList::SplitIDRangeExpression(current_arg);
|
|
|
|
if (!range_from.empty() && !range_to.empty()) {
|
2010-06-09 00:52:24 +08:00
|
|
|
is_range = true;
|
2016-10-06 01:07:47 +08:00
|
|
|
} else if (BreakpointID::StringIsBreakpointName(current_arg, error)) {
|
2010-06-09 00:52:24 +08:00
|
|
|
if (!error.Success()) {
|
|
|
|
new_args.Clear();
|
|
|
|
result.AppendError(error.AsCString());
|
|
|
|
result.SetStatus(eReturnStatusFailed);
|
|
|
|
return;
|
|
|
|
} else
|
2020-01-29 03:23:46 +08:00
|
|
|
names_found.insert(std::string(current_arg));
|
2016-11-23 01:10:15 +08:00
|
|
|
} else if ((i + 2 < old_args.size()) &&
|
2019-09-13 19:26:48 +08:00
|
|
|
BreakpointID::IsRangeIdentifier(old_args[i + 1].ref()) &&
|
2014-12-17 07:40:14 +08:00
|
|
|
BreakpointID::IsValidIDExpression(current_arg) &&
|
2019-09-13 19:26:48 +08:00
|
|
|
BreakpointID::IsValidIDExpression(old_args[i + 2].ref())) {
|
2016-10-06 01:07:47 +08:00
|
|
|
range_from = current_arg;
|
2019-09-13 19:26:48 +08:00
|
|
|
range_to = old_args[i + 2].ref();
|
2010-06-09 00:52:24 +08:00
|
|
|
is_range = true;
|
2016-09-07 04:57:50 +08:00
|
|
|
i = i + 2;
|
2010-06-09 00:52:24 +08:00
|
|
|
} else {
|
2010-09-30 03:42:33 +08:00
|
|
|
// See if user has specified id.*
|
2019-09-13 19:26:48 +08:00
|
|
|
llvm::StringRef tmp_str = old_args[i].ref();
|
2014-12-17 07:40:14 +08:00
|
|
|
size_t pos = tmp_str.find('.');
|
2016-10-06 01:07:47 +08:00
|
|
|
if (pos != llvm::StringRef::npos) {
|
|
|
|
llvm::StringRef bp_id_str = tmp_str.substr(0, pos);
|
|
|
|
if (BreakpointID::IsValidIDExpression(bp_id_str) &&
|
|
|
|
tmp_str[pos + 1] == '*' && tmp_str.size() == (pos + 2)) {
|
|
|
|
|
|
|
|
BreakpointSP breakpoint_sp;
|
|
|
|
auto bp_id = BreakpointID::ParseCanonicalReference(bp_id_str);
|
|
|
|
if (bp_id.hasValue())
|
|
|
|
breakpoint_sp = target->GetBreakpointByID(bp_id->GetBreakpointID());
|
2010-09-30 05:57:51 +08:00
|
|
|
if (!breakpoint_sp) {
|
2014-12-17 07:40:14 +08:00
|
|
|
new_args.Clear();
|
2010-09-30 05:57:51 +08:00
|
|
|
result.AppendErrorWithFormat("'%d' is not a valid breakpoint ID.\n",
|
2016-10-06 01:07:47 +08:00
|
|
|
bp_id->GetBreakpointID());
|
2014-12-17 07:40:14 +08:00
|
|
|
result.SetStatus(eReturnStatusFailed);
|
|
|
|
return;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2010-09-30 03:42:33 +08:00
|
|
|
const size_t num_locations = breakpoint_sp->GetNumLocations();
|
|
|
|
for (size_t j = 0; j < num_locations; ++j) {
|
|
|
|
BreakpointLocation *bp_loc =
|
|
|
|
breakpoint_sp->GetLocationAtIndex(j).get();
|
|
|
|
StreamString canonical_id_str;
|
2016-10-06 01:07:47 +08:00
|
|
|
BreakpointID::GetCanonicalReference(
|
|
|
|
&canonical_id_str, bp_id->GetBreakpointID(), bp_loc->GetID());
|
2016-09-20 01:54:06 +08:00
|
|
|
new_args.AppendArgument(canonical_id_str.GetString());
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2014-12-17 07:40:14 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2016-10-06 01:07:47 +08:00
|
|
|
if (!is_range) {
|
|
|
|
new_args.AppendArgument(current_arg);
|
|
|
|
continue;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2016-10-06 01:07:47 +08:00
|
|
|
auto start_bp = BreakpointID::ParseCanonicalReference(range_from);
|
|
|
|
auto end_bp = BreakpointID::ParseCanonicalReference(range_to);
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2016-10-06 01:07:47 +08:00
|
|
|
if (!start_bp.hasValue() ||
|
|
|
|
!target->GetBreakpointByID(start_bp->GetBreakpointID())) {
|
|
|
|
new_args.Clear();
|
|
|
|
result.AppendErrorWithFormat("'%s' is not a valid breakpoint ID.\n",
|
|
|
|
range_from.str().c_str());
|
|
|
|
result.SetStatus(eReturnStatusFailed);
|
|
|
|
return;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2016-10-06 01:07:47 +08:00
|
|
|
if (!end_bp.hasValue() ||
|
|
|
|
!target->GetBreakpointByID(end_bp->GetBreakpointID())) {
|
|
|
|
new_args.Clear();
|
|
|
|
result.AppendErrorWithFormat("'%s' is not a valid breakpoint ID.\n",
|
|
|
|
range_to.str().c_str());
|
|
|
|
result.SetStatus(eReturnStatusFailed);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
break_id_t start_bp_id = start_bp->GetBreakpointID();
|
|
|
|
break_id_t start_loc_id = start_bp->GetLocationID();
|
|
|
|
break_id_t end_bp_id = end_bp->GetBreakpointID();
|
|
|
|
break_id_t end_loc_id = end_bp->GetLocationID();
|
2016-10-06 02:40:51 +08:00
|
|
|
if (((start_loc_id == LLDB_INVALID_BREAK_ID) &&
|
|
|
|
(end_loc_id != LLDB_INVALID_BREAK_ID)) ||
|
2016-10-06 01:07:47 +08:00
|
|
|
((start_loc_id != LLDB_INVALID_BREAK_ID) &&
|
|
|
|
(end_loc_id == LLDB_INVALID_BREAK_ID))) {
|
|
|
|
new_args.Clear();
|
2020-07-21 13:57:06 +08:00
|
|
|
result.AppendError("Invalid breakpoint id range: Either "
|
|
|
|
"both ends of range must specify"
|
|
|
|
" a breakpoint location, or neither can "
|
2020-07-21 14:10:29 +08:00
|
|
|
"specify a breakpoint location.");
|
2016-10-06 01:07:47 +08:00
|
|
|
result.SetStatus(eReturnStatusFailed);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// We have valid range starting & ending breakpoint IDs. Go through all
|
2018-05-01 00:49:04 +08:00
|
|
|
// the breakpoints in the target and find all the breakpoints that fit into
|
|
|
|
// this range, and add them to new_args.
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2016-10-06 01:07:47 +08:00
|
|
|
// Next check to see if we have location id's. If so, make sure the
|
2018-05-01 00:49:04 +08:00
|
|
|
// start_bp_id and end_bp_id are for the same breakpoint; otherwise we have
|
|
|
|
// an illegal range: breakpoint id ranges that specify bp locations are NOT
|
|
|
|
// allowed to cross major bp id numbers.
|
2016-10-06 01:07:47 +08:00
|
|
|
|
|
|
|
if ((start_loc_id != LLDB_INVALID_BREAK_ID) ||
|
|
|
|
(end_loc_id != LLDB_INVALID_BREAK_ID)) {
|
|
|
|
if (start_bp_id != end_bp_id) {
|
2010-06-09 00:52:24 +08:00
|
|
|
new_args.Clear();
|
2016-10-06 01:07:47 +08:00
|
|
|
result.AppendErrorWithFormat(
|
|
|
|
"Invalid range: Ranges that specify particular breakpoint "
|
|
|
|
"locations"
|
|
|
|
" must be within the same major breakpoint; you specified two"
|
|
|
|
" different major breakpoints, %d and %d.\n",
|
|
|
|
start_bp_id, end_bp_id);
|
2010-09-30 03:42:33 +08:00
|
|
|
result.SetStatus(eReturnStatusFailed);
|
2016-09-07 04:57:50 +08:00
|
|
|
return;
|
|
|
|
}
|
2016-10-06 01:07:47 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2016-10-06 01:07:47 +08:00
|
|
|
const BreakpointList &breakpoints = target->GetBreakpointList();
|
|
|
|
const size_t num_breakpoints = breakpoints.GetSize();
|
|
|
|
for (size_t j = 0; j < num_breakpoints; ++j) {
|
|
|
|
Breakpoint *breakpoint = breakpoints.GetBreakpointAtIndex(j).get();
|
|
|
|
break_id_t cur_bp_id = breakpoint->GetID();
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2016-10-06 01:07:47 +08:00
|
|
|
if ((cur_bp_id < start_bp_id) || (cur_bp_id > end_bp_id))
|
|
|
|
continue;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2016-10-06 01:07:47 +08:00
|
|
|
const size_t num_locations = breakpoint->GetNumLocations();
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2016-10-06 01:07:47 +08:00
|
|
|
if ((cur_bp_id == start_bp_id) &&
|
|
|
|
(start_loc_id != LLDB_INVALID_BREAK_ID)) {
|
|
|
|
for (size_t k = 0; k < num_locations; ++k) {
|
|
|
|
BreakpointLocation *bp_loc = breakpoint->GetLocationAtIndex(k).get();
|
|
|
|
if ((bp_loc->GetID() >= start_loc_id) &&
|
|
|
|
(bp_loc->GetID() <= end_loc_id)) {
|
|
|
|
StreamString canonical_id_str;
|
|
|
|
BreakpointID::GetCanonicalReference(&canonical_id_str, cur_bp_id,
|
|
|
|
bp_loc->GetID());
|
|
|
|
new_args.AppendArgument(canonical_id_str.GetString());
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2016-10-06 01:07:47 +08:00
|
|
|
}
|
|
|
|
} else if ((cur_bp_id == end_bp_id) &&
|
|
|
|
(end_loc_id != LLDB_INVALID_BREAK_ID)) {
|
|
|
|
for (size_t k = 0; k < num_locations; ++k) {
|
|
|
|
BreakpointLocation *bp_loc = breakpoint->GetLocationAtIndex(k).get();
|
|
|
|
if (bp_loc->GetID() <= end_loc_id) {
|
|
|
|
StreamString canonical_id_str;
|
|
|
|
BreakpointID::GetCanonicalReference(&canonical_id_str, cur_bp_id,
|
|
|
|
bp_loc->GetID());
|
|
|
|
new_args.AppendArgument(canonical_id_str.GetString());
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
2016-10-06 01:07:47 +08:00
|
|
|
} else {
|
|
|
|
StreamString canonical_id_str;
|
|
|
|
BreakpointID::GetCanonicalReference(&canonical_id_str, cur_bp_id,
|
|
|
|
LLDB_INVALID_BREAK_ID);
|
|
|
|
new_args.AppendArgument(canonical_id_str.GetString());
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-17 07:40:14 +08:00
|
|
|
// Okay, now see if we found any names, and if we did, add them:
|
2017-09-15 04:22:49 +08:00
|
|
|
if (target && !names_found.empty()) {
|
|
|
|
Status error;
|
|
|
|
// Remove any names that aren't visible for this purpose:
|
|
|
|
auto iter = names_found.begin();
|
|
|
|
while (iter != names_found.end()) {
|
|
|
|
BreakpointName *bp_name = target->FindBreakpointName(ConstString(*iter),
|
|
|
|
true,
|
|
|
|
error);
|
|
|
|
if (bp_name && !bp_name->GetPermission(purpose))
|
|
|
|
iter = names_found.erase(iter);
|
|
|
|
else
|
|
|
|
iter++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!names_found.empty()) {
|
|
|
|
for (BreakpointSP bkpt_sp : target->GetBreakpointList().Breakpoints()) {
|
|
|
|
for (std::string name : names_found) {
|
|
|
|
if (bkpt_sp->MatchesName(name.c_str())) {
|
|
|
|
StreamString canonical_id_str;
|
|
|
|
BreakpointID::GetCanonicalReference(
|
|
|
|
&canonical_id_str, bkpt_sp->GetID(), LLDB_INVALID_BREAK_ID);
|
|
|
|
new_args.AppendArgument(canonical_id_str.GetString());
|
|
|
|
}
|
2014-12-17 07:40:14 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2014-12-17 07:40:14 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2014-12-17 07:40:14 +08:00
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
result.SetStatus(eReturnStatusSuccessFinishNoResult);
|
|
|
|
}
|
|
|
|
|
2016-10-06 01:07:47 +08:00
|
|
|
std::pair<llvm::StringRef, llvm::StringRef>
|
|
|
|
BreakpointIDList::SplitIDRangeExpression(llvm::StringRef in_string) {
|
|
|
|
for (auto specifier_str : BreakpointID::GetRangeSpecifiers()) {
|
|
|
|
size_t idx = in_string.find(specifier_str);
|
|
|
|
if (idx == llvm::StringRef::npos)
|
|
|
|
continue;
|
|
|
|
llvm::StringRef right1 = in_string.drop_front(idx);
|
|
|
|
|
|
|
|
llvm::StringRef from = in_string.take_front(idx);
|
|
|
|
llvm::StringRef to = right1.drop_front(specifier_str.size());
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2016-10-06 01:07:47 +08:00
|
|
|
if (BreakpointID::IsValidIDExpression(from) &&
|
|
|
|
BreakpointID::IsValidIDExpression(to)) {
|
|
|
|
return std::make_pair(from, to);
|
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
2016-10-06 01:07:47 +08:00
|
|
|
return std::pair<llvm::StringRef, llvm::StringRef>();
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|