This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: multiple-location breakpoint location
- From: Doug Evans <dje at google dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb at sourceware dot org
- Date: Sun, 7 Nov 2010 13:00:42 -0800
- Subject: Re: multiple-location breakpoint location
- References: <20101104195521.GL2464@adacore.com>
On Thu, Nov 4, 2010 at 12:55 PM, Joel Brobecker <brobecker@adacore.com> wrote:
> Assuming I have a function where the generated code and debug info
> looks like this:
>
> ? ? function bla:
> ? ? ? # line 5
> ? ? ? # line 6
> ? ? ? lexical_block:
> ? ? ? ? ?# line 5
> ? ? ? end lexical_block;
> ? ? end bla;
>
> If the user breaks on line 5 using "foo.adb:5", do you think that
> the debugger should insert 2 breakpoints?
>
> I looked at the manual, and it only provides example situations where
> multiple-location breakpoints should be inserted. Looking at the code
> for more details, I am a little confused. See expand_line_sal_maybe,
> which first does an expansion:
>
> ? * expanded = expand_line_sal (sal)
> ? ? The comment for that function says:
> ? ? /* Compute a set of all sals in all program spaces that correspond to
> ? ? ? ?same file and line as SAL and return those. ?If there are several
> ? ? ? ?sals that belong to the same block, only one sal for the block is
> ? ? ? ?included in results. ?*/
>
> ? * And then expand_line_sal_maybe eliminates further entries by
> ? ? comparing the associated function name to the function name
> ? ? associated to the original PC.
>
> I think I'm missing part of the picture, but we can still discuss and
> decide exactly what multiple-location breakpoints mean, from the user's
> point of view.
>
> Interestingly enough, I have the following slightly different situation:
>
> ? ?function bla:
> ? ? ? ?# line 5
> ? ? ? ?lexical_block:
> ? ? ? ? ? # line 6
> ? ? ? ? ? # line 7
> ? ? ? ? ? lexical_block:
> ? ? ? ? ? ? ?# line 6
> ? ? ? ? ? ? ?# line 8
> ? ? ? ? ? end lexical_block;
> ? ? ? ?end lexical_block;
> ? ?end function;
>
> In that case, a breakpoint on line 6 results in 1 breakpoint location.
> This seems to support the suggestion that we should only have one
> location in the first situation.
That is my understanding.