diff options
author | Jim Ingham <jingham@apple.com> | 2013-09-10 02:06:17 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2013-09-10 02:06:17 +0000 |
commit | df59c4a93744e3f827f4d7fe9f35e06e31966520 (patch) | |
tree | 1a20284f21617f104d1ec10ab11fba959cad4bcb /lldb/source/Breakpoint/BreakpointResolverFileLine.cpp | |
parent | 0dca2e5ed11a25f8eda7dd83b4d3168bcfaab6a2 (diff) | |
download | bcm5719-llvm-df59c4a93744e3f827f4d7fe9f35e06e31966520.tar.gz bcm5719-llvm-df59c4a93744e3f827f4d7fe9f35e06e31966520.zip |
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>
llvm-svn: 190380
Diffstat (limited to 'lldb/source/Breakpoint/BreakpointResolverFileLine.cpp')
-rw-r--r-- | lldb/source/Breakpoint/BreakpointResolverFileLine.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp index 91a218fdb80..005253d3f77 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<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; + } } } |