[lldb-dev] lldb fails to hit breakpoint when line maps to multiple addresses
Greg Clayton via lldb-dev
lldb-dev at lists.llvm.org
Wed Sep 23 11:44:41 PDT 2015
We currently coalesce breakpoints to avoid the user stopping multiple times on the same source line. This might have been done to avoid stepping issues we might have had in the past, but we have made many modifications to stepping such that the step thread plans now know how to step through two hits from the same source line. I would need Jim to confirm this, but he is out for 2 weeks.
So this is on purpose and is expected. Not sure what will happen if we disable this coalescing of locations that are contiguous. Feel free to try and disable it and run the test suite and see how things go. Don't check anything in, but you could try disabling it on your branch and see how things go. Then when Jim returns we can confirm with him what the right thing to do is.
Greg Clayton
> On Sep 22, 2015, at 6:44 PM, via lldb-dev <lldb-dev at lists.llvm.org> wrote:
>
> We have a case where a source breakpoint isn't hit because the source line maps
> to 2 addresses in the debug info and lldb only sets 1 BP on the first address
> which is in a basic block that is rarely executed. The codegen looks something
> like this (in pseudo code):
>
> some_code
> br lbl2
> lbl1:
> some_more_code
> code_for_line_50_pt1 ; lldb sets BP here but code not executed
> lbl2:
> code_for_line_48
> code_for_line_50_pt2 ; this code is executed
> if (cond) br lbl1
>
> BreakpointResolverFileLine::SearchCallback correctly finds both symbol contexts
> for the line. The symbol contexts have different addresses but the same
> lldb_private::Block. As a result, BreakpointResolver::SetSCMatchesByLine
> thinks they are in the same "contiguous range" and removes the 2nd symbol
> context. lldb sets the breakpoint at the 1st address and the user never hits
> their breakpoint.
>
> The check for a "contiguous range" in BreakpointResolver::SetSCMatchesByLine
> seems wrong. Is it assuming a Block is actually a basic block (i.e. with no
> branches)? What's supposed to happen here?
>
> Thanks,
> -Dawn
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
More information about the lldb-dev
mailing list