[RFC] canonical linespec and multiple breakpoints ...

Joel Brobecker
2011-05-05T16:29:18Z

Hello,

Re: [PATCH 2/6] Introduce `pre_expanded sals'
http://www.sourceware.org/ml/gdb-patches/2011-04/msg00038.html
http://www.sourceware.org/ml/gdb-patches/2011-05/msg00074.html

Jerome and I were discussing a way to move foward without having
to design everything, as the week is rapidly getting to a close.
(Jerome heads back to Paris at the end of this week, and will
be back to his normal schedule, so we're trying to take advantage
of his presence his as much as we can).

If we agree that a breakpoint expression (linespec) that gets resolved
into multiple source locations (slocs) should result in one breakpoint
per sloc, then we can start working on that.

The above requires that we agree on a way to make sure that each
breakpoint carries enough information to re-set itself, which means
that the information should make the breakpoint unique. We've handled
that issue by using a canonical linespec (FILE:FUNCTION:LINE), and
it has worked well for us.

I think that implementing the above in a way that allows each language
to implement their own way of dealing with templates/generics/homonyms
should be reasonably easy, and we'd still be much farther ahead than
we are now. What Jerome and I propose is that we implement the
infrastructure to make it work for C, and possibly Ada (we'll probably
wait for the Ada bits until the infrastructure is approved). We would
rather let the C++ bits to someone else, as we still have limited
experience with C++ itself.

We think that this will handle most situations, except the situation
where new symbols cause extra slocs to appear (typically, a shared
library gets mapped in memory). We are planing on plugging that hole
as a followup, which can be made independently, for instance using
Pedro's idea of introducing an extra level of breakpoint. The exact
details on how this is going to be done need to be discussed, but,
in the meantime, our experience with Ada show that the approach
we are proposing as a first step has been working well for our users.

Thoughts?

Thanks,
--
Joel