summaryrefslogtreecommitdiffstats
path: root/lldb/source/Breakpoint/BreakpointIDList.cpp
diff options
context:
space:
mode:
authorCaroline Tice <ctice@apple.com>2011-02-02 17:48:16 +0000
committerCaroline Tice <ctice@apple.com>2011-02-02 17:48:16 +0000
commit2bf67986efa6114df72535085df4337e9208ce6b (patch)
treecedb67d2798df52c968d1ffa6af6c7c77ecb9e14 /lldb/source/Breakpoint/BreakpointIDList.cpp
parentda3b02fdb3cfa7ba6e7edbdf00ac9db6d6b55bbe (diff)
downloadbcm5719-llvm-2bf67986efa6114df72535085df4337e9208ce6b.tar.gz
bcm5719-llvm-2bf67986efa6114df72535085df4337e9208ce6b.zip
Fix breakpoint id test to work with clang as well as gcc; added a few
more test cases Fixed minor bug in the breakpoint id range translation code. llvm-svn: 124729
Diffstat (limited to 'lldb/source/Breakpoint/BreakpointIDList.cpp')
-rw-r--r--lldb/source/Breakpoint/BreakpointIDList.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/lldb/source/Breakpoint/BreakpointIDList.cpp b/lldb/source/Breakpoint/BreakpointIDList.cpp
index 50a89c72066..b4a80705548 100644
--- a/lldb/source/Breakpoint/BreakpointIDList.cpp
+++ b/lldb/source/Breakpoint/BreakpointIDList.cpp
@@ -258,6 +258,19 @@ BreakpointIDList::FindAndReplaceIDRanges (Args &old_args, Target *target, Comman
result.SetStatus (eReturnStatusFailed);
return;
}
+
+
+ if (((start_loc_id == LLDB_INVALID_BREAK_ID)
+ && (end_loc_id != LLDB_INVALID_BREAK_ID))
+ || ((start_loc_id != LLDB_INVALID_BREAK_ID)
+ && (end_loc_id == LLDB_INVALID_BREAK_ID)))
+ {
+ new_args.Clear ();
+ result.AppendErrorWithFormat ("Invalid breakpoint id range: Either both ends of range must specify"
+ " a breakpoint location, or neither can specify a breakpoint location.\n");
+ result.SetStatus (eReturnStatusFailed);
+ return;
+ }
// We have valid range starting & ending breakpoint IDs. Go through all the breakpoints in the
// target and find all the breakpoints that fit into this range, and add them to new_args.
@@ -298,7 +311,7 @@ BreakpointIDList::FindAndReplaceIDRanges (Args &old_args, Target *target, Comman
for (size_t k = 0; k < num_locations; ++k)
{
BreakpointLocation * bp_loc = breakpoint->GetLocationAtIndex(k).get();
- if (bp_loc->GetID() >= start_loc_id)
+ 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());
OpenPOWER on IntegriCloud