Re: can't step into, or print variables inside of C++ template function

Brian Budge
2011-04-27T16:43:33Z

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
>