public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* can't step into, or print variables inside of C++ template function
@ 2011-04-27 16:41 Brian Budge
  2011-04-27 16:43 ` Brian Budge
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Budge @ 2011-04-27 16:41 UTC (permalink / raw)
  To: gdb

Hi all -

We're using GDB to debug a C++ project, and we're running into
something new:  We can set a breakpoint in a template function (more
precisely, a method inside a template class), but we can't list the
source there, we can't step or next reliably from there, and we can't
print the values of local variables there.

We tried explicitly instantiating the templates in their own
translation unit, but this didn't help with the problem.  We have
tried gdb 7.0.1 and 7.2.  We're using g++ 4.5.1 under Ubuntu on
x86-64.

I should also mention we've been using gdb to debug this exact code
for well over a year.  I'm not positive, but it's possible that we
upgraded from gcc 4.4 to 4.5 since we last debugged this specific
piece of code.

Has anyone seen this?  Is there a workaround?

Thanks,
  Brian

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

* Re: can't step into, or print variables inside of C++ template function
  2011-04-27 16:41 can't step into, or print variables inside of C++ template function Brian Budge
@ 2011-04-27 16:43 ` Brian Budge
  2011-04-29 13:15   ` Jan Kratochvil
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Budge @ 2011-04-27 16:43 UTC (permalink / raw)
  To: gdb

A quick update:  This works under gcc 4.4.  Unsure if a bug should be
filed against gdb to work with newer debug information, or against gcc
for breaking the debug information.

Thanks,
  Brian

On Wed, Apr 27, 2011 at 9:41 AM, Brian Budge <brian.budge@gmail.com> wrote:
> Hi all -
>
> We're using GDB to debug a C++ project, and we're running into
> something new:  We can set a breakpoint in a template function (more
> precisely, a method inside a template class), but we can't list the
> source there, we can't step or next reliably from there, and we can't
> print the values of local variables there.
>
> We tried explicitly instantiating the templates in their own
> translation unit, but this didn't help with the problem.  We have
> tried gdb 7.0.1 and 7.2.  We're using g++ 4.5.1 under Ubuntu on
> x86-64.
>
> I should also mention we've been using gdb to debug this exact code
> for well over a year.  I'm not positive, but it's possible that we
> upgraded from gcc 4.4 to 4.5 since we last debugged this specific
> piece of code.
>
> Has anyone seen this?  Is there a workaround?
>
> Thanks,
>  Brian
>

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

* Re: can't step into, or print variables inside of C++ template function
  2011-04-27 16:43 ` Brian Budge
@ 2011-04-29 13:15   ` Jan Kratochvil
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Kratochvil @ 2011-04-29 13:15 UTC (permalink / raw)
  To: Brian Budge; +Cc: gdb

On Wed, 27 Apr 2011 18:43:16 +0200, Brian Budge wrote:
> A quick update:  This works under gcc 4.4.  Unsure if a bug should be
> filed against gdb to work with newer debug information, or against gcc
> for breaking the debug information.

Sometimes it is GCC bug, sometimes GDB bug.  But the GCC or GDB maintainers
will reassign it appropriately when needed.

It is more important to file a reproducer, I cannot say anything more about
it.  Both GCC and GDB have heavy regression testsuites and apparently this
case is not yet covered there.


Thanks,
Jan

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

end of thread, other threads:[~2011-04-29 13:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-27 16:41 can't step into, or print variables inside of C++ template function Brian Budge
2011-04-27 16:43 ` Brian Budge
2011-04-29 13:15   ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).