Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* template breakpoints
@ 2007-10-06  5:10 Douglas Evans
  2007-10-06 10:43 ` Vladimir Prus
  0 siblings, 1 reply; 8+ messages in thread
From: Douglas Evans @ 2007-10-06  5:10 UTC (permalink / raw)
  To: drow, gdb

Hi.  I'm looking into improving support for template breakpoints
(where one file:line can map to several different pc addresses).
Daniel posted a patch in early 2005 that has the beginnings of a
solution.  Is this still the preferred approach?  Is anyone currently
working on this?  Does anyone have any further thoughts on what the
solution should/shouldn't involve?

TIA.

Here's the patch
http://sources.redhat.com/ml/gdb-patches/2005-03/msg00195.html

with further discussion here
http://sourceware.org/ml/gdb/2006-01/msg00108.html

I couldn't find more recent discussion.  Any further pointers would
certainly be welcome.  Thanks.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: template breakpoints
  2007-10-06  5:10 template breakpoints Douglas Evans
@ 2007-10-06 10:43 ` Vladimir Prus
  2007-10-06 18:09   ` Douglas Evans
  2007-10-08 22:35   ` Douglas Evans
  0 siblings, 2 replies; 8+ messages in thread
From: Vladimir Prus @ 2007-10-06 10:43 UTC (permalink / raw)
  To: gdb

Douglas Evans wrote:

> Hi.  I'm looking into improving support for template breakpoints
> (where one file:line can map to several different pc addresses).
> Daniel posted a patch in early 2005 that has the beginnings of a
> solution.  Is this still the preferred approach?  Is anyone currently
> working on this?  Does anyone have any further thoughts on what the
> solution should/shouldn't involve?

The patches to support such breakpoints were checked in recently, so
you might want to try CVS HEAD. The patches missed the GDB 6.7 window,
so won't be released until GDB 6.8.
And there's even documentation.

- VOlodya


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: template breakpoints
  2007-10-06 10:43 ` Vladimir Prus
@ 2007-10-06 18:09   ` Douglas Evans
  2007-10-08 22:35   ` Douglas Evans
  1 sibling, 0 replies; 8+ messages in thread
From: Douglas Evans @ 2007-10-06 18:09 UTC (permalink / raw)
  To: Vladimir Prus; +Cc: gdb

Awesome.  Thanks.

On 10/6/07, Vladimir Prus <ghost@cs.msu.su> wrote:
> Douglas Evans wrote:
>
> > Hi.  I'm looking into improving support for template breakpoints
> > [...]
>
> The patches to support such breakpoints were checked in recently, so
> you might want to try CVS HEAD. The patches missed the GDB 6.7 window,
> so won't be released until GDB 6.8.
> And there's even documentation.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: template breakpoints
  2007-10-06 10:43 ` Vladimir Prus
  2007-10-06 18:09   ` Douglas Evans
@ 2007-10-08 22:35   ` Douglas Evans
  2007-10-09  4:57     ` Vladimir Prus
  1 sibling, 1 reply; 8+ messages in thread
From: Douglas Evans @ 2007-10-08 22:35 UTC (permalink / raw)
  To: Vladimir Prus; +Cc: gdb

On 10/6/07, Vladimir Prus <ghost@cs.msu.su> wrote:
> Douglas Evans wrote:
>
> > Hi.  I'm looking into improving support for template breakpoints
> > (where one file:line can map to several different pc addresses).
>
> The patches to support such breakpoints were checked in recently, so
> you might want to try CVS HEAD. The patches missed the GDB 6.7 window,
> so won't be released until GDB 6.8.
> And there's even documentation.

Hi.  I downloaded and tried the new support.  Nice.  I noticed that
while enable/disable work with the new "multiple breakpoints",
condition/ignore/commands don't (currently) work.  Is there a plan to
support these with the new breakpoints as well?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: template breakpoints
  2007-10-08 22:35   ` Douglas Evans
@ 2007-10-09  4:57     ` Vladimir Prus
  2007-10-09 17:44       ` Douglas Evans
  0 siblings, 1 reply; 8+ messages in thread
From: Vladimir Prus @ 2007-10-09  4:57 UTC (permalink / raw)
  To: Douglas Evans; +Cc: gdb

On Tuesday 09 October 2007 02:35:35 Douglas Evans wrote:
> On 10/6/07, Vladimir Prus <ghost@cs.msu.su> wrote:
> > Douglas Evans wrote:
> >
> > > Hi.  I'm looking into improving support for template breakpoints
> > > (where one file:line can map to several different pc addresses).
> >
> > The patches to support such breakpoints were checked in recently, so
> > you might want to try CVS HEAD. The patches missed the GDB 6.7 window,
> > so won't be released until GDB 6.8.
> > And there's even documentation.
> 
> Hi.  I downloaded and tried the new support.  Nice.  I noticed that
> while enable/disable work with the new "multiple breakpoints",
> condition/ignore/commands don't (currently) work.  Is there a plan to
> support these with the new breakpoints as well?

They are supposed to work. Can you provide a self-contained (source) program,
and a set of gdb commands that reproduce the problem?

- Volodya


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: template breakpoints
  2007-10-09  4:57     ` Vladimir Prus
@ 2007-10-09 17:44       ` Douglas Evans
  2007-10-09 17:57         ` Vladimir Prus
  0 siblings, 1 reply; 8+ messages in thread
From: Douglas Evans @ 2007-10-09 17:44 UTC (permalink / raw)
  To: Vladimir Prus; +Cc: gdb

On 10/8/07, Vladimir Prus <ghost@cs.msu.su> wrote:
> On Tuesday 09 October 2007 02:35:35 Douglas Evans wrote:
> > Hi.  I downloaded and tried the new support.  Nice.  I noticed that
> > while enable/disable work with the new "multiple breakpoints",
> > condition/ignore/commands don't (currently) work.  Is there a plan to
> > support these with the new breakpoints as well?
>
> They are supposed to work. Can you provide a self-contained (source) program,
> and a set of gdb commands that reproduce the problem?

Appended is the session log.  The testcase is testsuite/gdb.cp/mb-templates.cc.

Note that in breakpoints.cc {enable,disable}_command do a strchr
(args, '.') to watch for a.b spelled breakpoints where as
{commands,ignore,condition}_command just call get_number.  And
delete_command calls get_number_or_range via map_breakpoint_numbers.
[Assuming I'm reading the code correctly ...]

Also, note that by "support" I mean one can, for example, set a
condition on individual breakpoints within the multi-breakpoint(sp?).
[Just making sure we're on the same page ...] Allowing the deletion of
individual multi-breakpoints may be dubious (dunno) but the others
seem useful.

---
dje@ruffy:~/fsf/sourceware/head/obj/gdb/testsuite/gdb.cp$ ../../gdb mb-template\
s
GNU gdb 6.7.50-20071009-cvs
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i386-linux"...
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) b mb-templates.cc:8
Breakpoint 1 at 0x8048652: file ../../../src/gdb/testsuite/gdb.cp/mb-templates.\
cc, line 8. (2 locations)
(gdb) i b
Num     Type           Disp Enb  Address    What
1       breakpoint     keep y    <MULTIPLE>
1.1                         y    0x08048652 in void foo<int>(int)
                                       at ../../../src/gdb/testsuite/gdb.cp/mb-\
templates.cc:8
1.2                         y    0x0804867a in void foo<double>(double)
                                       at ../../../src/gdb/testsuite/gdb.cp/mb-\
templates.cc:8
(gdb) disable 1.1
(gdb) i b
Num     Type           Disp Enb  Address    What
1       breakpoint     keep y    <MULTIPLE>
1.1                         n    0x08048652 in void foo<int>(int)
                                       at ../../../src/gdb/testsuite/gdb.cp/mb-\
templates.cc:8
1.2                         y    0x0804867a in void foo<double>(double)
                                       at ../../../src/gdb/testsuite/gdb.cp/mb-\
templates.cc:8
(gdb) enable 1.1
(gdb) i b
Num     Type           Disp Enb  Address    What
1       breakpoint     keep y    <MULTIPLE>
1.1                         y    0x08048652 in void foo<int>(int)
                                       at ../../../src/gdb/testsuite/gdb.cp/mb-\
templates.cc:8
1.2                         y    0x0804867a in void foo<double>(double)
                                       at ../../../src/gdb/testsuite/gdb.cp/mb-\
templates.cc:8
(gdb) commands 1.1
No breakpoint number 0.
(gdb) ignore 1.1 3
bad breakpoint number: '1.1 3'
(gdb) cond 1.1
Bad breakpoint argument: '1.1'
(gdb) delete 1.1
warning: bad breakpoint number at or near '1.1'
(gdb)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: template breakpoints
  2007-10-09 17:44       ` Douglas Evans
@ 2007-10-09 17:57         ` Vladimir Prus
  2007-10-09 20:17           ` Douglas Evans
  0 siblings, 1 reply; 8+ messages in thread
From: Vladimir Prus @ 2007-10-09 17:57 UTC (permalink / raw)
  To: Douglas Evans; +Cc: gdb

On Tuesday 09 October 2007 21:44:17 Douglas Evans wrote:
> On 10/8/07, Vladimir Prus <ghost@cs.msu.su> wrote:
> > On Tuesday 09 October 2007 02:35:35 Douglas Evans wrote:
> > > Hi.  I downloaded and tried the new support.  Nice.  I noticed that
> > > while enable/disable work with the new "multiple breakpoints",
> > > condition/ignore/commands don't (currently) work.  Is there a plan to
> > > support these with the new breakpoints as well?
> >
> > They are supposed to work. Can you provide a self-contained (source) program,
> > and a set of gdb commands that reproduce the problem?
> 
> Appended is the session log.  The testcase is testsuite/gdb.cp/mb-templates.cc.
> 
> Note that in breakpoints.cc {enable,disable}_command do a strchr
> (args, '.') to watch for a.b spelled breakpoints where as
> {commands,ignore,condition}_command just call get_number.  And
> delete_command calls get_number_or_range via map_breakpoint_numbers.
> [Assuming I'm reading the code correctly ...]
> 
> Also, note that by "support" I mean one can, for example, set a
> condition on individual breakpoints within the multi-breakpoint(sp?).
> [Just making sure we're on the same page ...]

Ah, I see what you mean. As it stands now, condition, command, and ignore
count is per-breakpoint, not per-location. It was suggested that ignore count
and hit count be made per-breakpoint, but was outside the code of the original
work.

As for condition, I'm not sure. On code level it's not hard to support, but there
are issues. 

First issue is technical. A breakpoint is reevaluated as any
shared library is loaded and unloaded. If you set per-location
condition, you probably want that condition to be still active
after the library containing the location is unloaded and reloaded
several time, and application restarted. To do that, we need to somehow
track location's identity, and I don't know 100% reliable solution.
We have similar problem with enable/disable state, but there, at worst
case you'll stop on location you don't care about. With per-location
condition, you can just loose your condition.

Another issue is "why?". Presumably, if you want a specific condition
for just one template instantiation, you can just set breakpoint on
that template instatiation? I basically worry that the user interface
will become too complex to be usable.

- Volodya


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: template breakpoints
  2007-10-09 17:57         ` Vladimir Prus
@ 2007-10-09 20:17           ` Douglas Evans
  0 siblings, 0 replies; 8+ messages in thread
From: Douglas Evans @ 2007-10-09 20:17 UTC (permalink / raw)
  To: Vladimir Prus; +Cc: gdb

On 10/9/07, Vladimir Prus <vladimir@codesourcery.com> wrote:
>
> Ah, I see what you mean. As it stands now, condition, command, and ignore
> count is per-breakpoint, not per-location. It was suggested that ignore count
> and hit count be made per-breakpoint, but was outside the code of the original
                                    ^^^^^^^^^^^^^^^^^
> work.


The phrasing here is a bit confusing.  Did you mean per-location here
(^^^^) ?  [I'm not suggesting an opinion on what it should be, just
trying to understand the current plan.]


>  As for condition, I'm not sure. On code level it's not hard to support, but there
> are issues.
>
> First issue is technical. A breakpoint is reevaluated as any
> shared library is loaded and unloaded. If you set per-location
> condition, you probably want that condition to be still active
> after the library containing the location is unloaded and reloaded
> several time, and application restarted. To do that, we need to somehow
> track location's identity, and I don't know 100% reliable solution.
> We have similar problem with enable/disable state, but there, at worst
> case you'll stop on location you don't care about. With per-location
> condition, you can just loose your condition.
>
> Another issue is "why?". Presumably, if you want a specific condition
> for just one template instantiation, you can just set breakpoint on
> that template instatiation? I basically worry that the user interface
> will become too complex to be usable.

Thanks.  I'm all for a good u/i.  At the moment I'm just trying to
understand what the plan is going forward.

How about breakpoint commands?  Are they considered akin to conditions
(and thus the plan is to leave them as is)?


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-10-09 20:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-06  5:10 template breakpoints Douglas Evans
2007-10-06 10:43 ` Vladimir Prus
2007-10-06 18:09   ` Douglas Evans
2007-10-08 22:35   ` Douglas Evans
2007-10-09  4:57     ` Vladimir Prus
2007-10-09 17:44       ` Douglas Evans
2007-10-09 17:57         ` Vladimir Prus
2007-10-09 20:17           ` Douglas Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox