Author: jingham Date: Mon Sep 9 21:06:17 2013 New Revision: 190380 URL: http://llvm.org/viewvc/llvm-project?rev=190380&view=rev Log: 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.
<rdar://problem/14920404> Modified: lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp Modified: lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp?rev=190380&r1=190379&r2=190380&view=diff ============================================================================== --- lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp (original) +++ lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp Mon Sep 9 21:06:17 2013 @@ -140,21 +140,20 @@ BreakpointResolverFileLine::SearchCallba // 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<Block *, lldb::addr_t> 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<Block *, lldb::addr_t>(sc.block, sc.line_entry.range.GetBaseAddress().GetFileAddress())); current_idx++; - - last_end_addr = end_file_addr; + } } } _______________________________________________ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits