* GDB <MULTIPLE> breakpoints, source lines
@ 2009-02-14 9:29 Peter Wainwright
2009-02-14 10:22 ` Vladimir Prus
0 siblings, 1 reply; 6+ messages in thread
From: Peter Wainwright @ 2009-02-14 9:29 UTC (permalink / raw)
To: gdb
Hi,
I'm the maintainer of DDD. I have some questions about the intent of
the gdb <MULTIPLE> breakpoints.
"info break" returns several lines for each breakpoint, e.g.
2.1 y 0x00007f2e2090c4d4 in
VoxelBuffer<char>::buffer_type() const
at ../VoxelBuffer.cc:95
2.2 y 0x00007f2e2090c540 in
VoxelBuffer<unsigned char>::buffer_type() const at ../VoxelBuffer.cc:95
2.3 y 0x00007f2e2090c5ac in
VoxelBuffer<short>::buffer_type() const
at ../VoxelBuffer.cc:95
The info page on breakpoints mentions 3 use cases: constructors,
templates, and inlined functions. In all 3 cases the multiple locations
are generated from a single source line. However, the "info break"
display shows a source file and line number for each location.
My question is: are there any circumstances in which you can get a
different source file or line for each location?
Thanks,
Peter Wainwright
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: GDB <MULTIPLE> breakpoints, source lines
2009-02-14 9:29 GDB <MULTIPLE> breakpoints, source lines Peter Wainwright
@ 2009-02-14 10:22 ` Vladimir Prus
2009-02-14 12:03 ` Peter Wainwright
2009-02-14 16:08 ` Daniel Jacobowitz
0 siblings, 2 replies; 6+ messages in thread
From: Vladimir Prus @ 2009-02-14 10:22 UTC (permalink / raw)
To: gdb
Peter Wainwright wrote:
> Hi,
>
> I'm the maintainer of DDD. I have some questions about the intent of
> the gdb <MULTIPLE> breakpoints.
>
> "info break" returns several lines for each breakpoint, e.g.
>
> 2.1 y 0x00007f2e2090c4d4 in
> VoxelBuffer<char>::buffer_type() const
> at ../VoxelBuffer.cc:95
> 2.2 y 0x00007f2e2090c540 in
> VoxelBuffer<unsigned char>::buffer_type() const at ../VoxelBuffer.cc:95
> 2.3 y 0x00007f2e2090c5ac in
> VoxelBuffer<short>::buffer_type() const
> at ../VoxelBuffer.cc:95
>
> The info page on breakpoints mentions 3 use cases: constructors,
> templates, and inlined functions. In all 3 cases the multiple locations
> are generated from a single source line. However, the "info break"
> display shows a source file and line number for each location.
>
> My question is: are there any circumstances in which you can get a
> different source file or line for each location?
There should be none, except that we had a bug report whereby GDB would
create multiple location breakpoint where each location has the same
line number and file basename, but different directories.
I think you better assume the source location is always the same. You might
consider if you actually want to display individual locations at all --
unless the user is in position to do something with address, that information
is of no use.
- Volodya
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB <MULTIPLE> breakpoints, source lines
2009-02-14 10:22 ` Vladimir Prus
@ 2009-02-14 12:03 ` Peter Wainwright
2009-02-14 16:08 ` Daniel Jacobowitz
1 sibling, 0 replies; 6+ messages in thread
From: Peter Wainwright @ 2009-02-14 12:03 UTC (permalink / raw)
To: Vladimir Prus; +Cc: gdb
On Sat, 2009-02-14 at 13:22 +0300, Vladimir Prus wrote:
> Peter Wainwright wrote:
>
> > Hi,
> >
> > I'm the maintainer of DDD. I have some questions about the intent of
> > the gdb <MULTIPLE> breakpoints.
> >
> > "info break" returns several lines for each breakpoint, e.g.
> >
> > 2.1 y 0x00007f2e2090c4d4 in
> > VoxelBuffer<char>::buffer_type() const
> > at ../VoxelBuffer.cc:95
> > 2.2 y 0x00007f2e2090c540 in
> > VoxelBuffer<unsigned char>::buffer_type() const at ../VoxelBuffer.cc:95
> > 2.3 y 0x00007f2e2090c5ac in
> > VoxelBuffer<short>::buffer_type() const
> > at ../VoxelBuffer.cc:95
> >
> > The info page on breakpoints mentions 3 use cases: constructors,
> > templates, and inlined functions. In all 3 cases the multiple locations
> > are generated from a single source line. However, the "info break"
> > display shows a source file and line number for each location.
> >
> > My question is: are there any circumstances in which you can get a
> > different source file or line for each location?
>
> There should be none, except that we had a bug report whereby GDB would
> create multiple location breakpoint where each location has the same
> line number and file basename, but different directories.
>
> I think you better assume the source location is always the same. You might
> consider if you actually want to display individual locations at all --
> unless the user is in position to do something with address, that information
> is of no use.
>
> - Volodya
Thanks, that makes things a bit simpler. We do need to parse and record
the information for each location, because DDD displays a "glyph" to
indicate the breakpoint location in the machine code display window.
But at least it seems we can make do with only one glyph for the source
code window.
(I suppose I can imagine cases in which the user might want to
enable/disable the individual locations separately, but that seems to be
a rather obscure case).
Peter
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB <MULTIPLE> breakpoints, source lines
2009-02-14 10:22 ` Vladimir Prus
2009-02-14 12:03 ` Peter Wainwright
@ 2009-02-14 16:08 ` Daniel Jacobowitz
2009-02-14 16:39 ` Pierre Muller
2009-02-14 16:43 ` Vladimir Prus
1 sibling, 2 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2009-02-14 16:08 UTC (permalink / raw)
To: gdb
On Sat, Feb 14, 2009 at 01:22:38PM +0300, Vladimir Prus wrote:
> > My question is: are there any circumstances in which you can get a
> > different source file or line for each location?
>
> There should be none, except that we had a bug report whereby GDB would
> create multiple location breakpoint where each location has the same
> line number and file basename, but different directories.
Do you think we'll ever use these for e.g. breakpoints on overloaded
functions?
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB <MULTIPLE> breakpoints, source lines
2009-02-14 16:08 ` Daniel Jacobowitz
@ 2009-02-14 16:39 ` Pierre Muller
2009-02-14 16:43 ` Vladimir Prus
1 sibling, 0 replies; 6+ messages in thread
From: Pierre Muller @ 2009-02-14 16:39 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb
Daniel Jacobowitz <drow@false.org> a écrit :
> On Sat, Feb 14, 2009 at 01:22:38PM +0300, Vladimir Prus wrote:
>> > My question is: are there any circumstances in which you can get a
>> > different source file or line for each location?
>>
>> There should be none, except that we had a bug report whereby GDB would
>> create multiple location breakpoint where each location has the same
>> line number and file basename, but different directories.
>
> Do you think we'll ever use these for e.g. breakpoints on overloaded
> functions?
I would really like to use them for global overloaded
functions in pascal!
But I didn't yet have time to look into this seriously :(
Pierre Muller
GDB pascal language support maintainer
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB <MULTIPLE> breakpoints, source lines
2009-02-14 16:08 ` Daniel Jacobowitz
2009-02-14 16:39 ` Pierre Muller
@ 2009-02-14 16:43 ` Vladimir Prus
1 sibling, 0 replies; 6+ messages in thread
From: Vladimir Prus @ 2009-02-14 16:43 UTC (permalink / raw)
To: gdb
Daniel Jacobowitz wrote:
> On Sat, Feb 14, 2009 at 01:22:38PM +0300, Vladimir Prus wrote:
>> > My question is: are there any circumstances in which you can get a
>> > different source file or line for each location?
>>
>> There should be none, except that we had a bug report whereby GDB would
>> create multiple location breakpoint where each location has the same
>> line number and file basename, but different directories.
>
> Do you think we'll ever use these for e.g. breakpoints on overloaded
> functions?
I don't know. I never had a particular design to set breakpoint on
every overloaded function. In case of constructors/templates/inlined
function you are very likely to have no idea of the address of the instance
you care about. Overloaded functions are basically separate functions that
happen to share a part of the name, so user is much more likely to know
which function he wants to debug.
- Volodya
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-02-14 16:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-14 9:29 GDB <MULTIPLE> breakpoints, source lines Peter Wainwright
2009-02-14 10:22 ` Vladimir Prus
2009-02-14 12:03 ` Peter Wainwright
2009-02-14 16:08 ` Daniel Jacobowitz
2009-02-14 16:39 ` Pierre Muller
2009-02-14 16:43 ` Vladimir Prus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox