From df59c4a93744e3f827f4d7fe9f35e06e31966520 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Tue, 10 Sep 2013 02:06:17 +0000 Subject: [PATCH] Change the "breakpoint fuzz" algorithm from "coalesce the line ranges for a file & line breakpoint if they are contiguous" to "coalesce the line ranges for a file & line breakpoint to the first range in each block". We were still setting a silly number of independent breakpoints sometimes, and until we get a compiler that emits trustworthy is_stmt flags in the line table, we need to do something to reduce the noise. llvm-svn: 190380 --- lldb/source/Breakpoint/BreakpointResolverFileLine.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp index 91a218f..005253d 100644 --- a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp +++ b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp @@ -140,21 +140,20 @@ BreakpointResolverFileLine::SearchCallback // Next go through and see if there are line table entries that are contiguous, and if so keep only the // first of the contiguous range: - lldb::addr_t last_end_addr = LLDB_INVALID_ADDRESS; current_idx = 0; + std::map blocks_with_breakpoints; + while (current_idx < tmp_sc_list.GetSize()) { if (tmp_sc_list.GetContextAtIndex(current_idx, sc)) { - lldb::addr_t start_file_addr = sc.line_entry.range.GetBaseAddress().GetFileAddress(); - lldb::addr_t end_file_addr = start_file_addr + sc.line_entry.range.GetByteSize(); - - if (start_file_addr == last_end_addr) + if (blocks_with_breakpoints.find (sc.block) != blocks_with_breakpoints.end()) tmp_sc_list.RemoveContextAtIndex(current_idx); else + { + blocks_with_breakpoints.insert (std::pair(sc.block, sc.line_entry.range.GetBaseAddress().GetFileAddress())); current_idx++; - - last_end_addr = end_file_addr; + } } } -- 2.7.4