[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] C++ templates and debugging (limitations) in Linux



On Thu, Jan 29, 2009 at 1:47 PM, H.S. <hs.samix@gmail.com> wrote:
> Hello,
>
> This is related to templates in C++ and debugging tools we have in Linux
> (I use gdb, is there any other comparable open source tool?).
>
>
> What do C++ programmers here think about the usefulness of using
> templates in C++ while keeping in mind how it would work with debugging
> that program using gdb.
>
> I recall that a few years ago (a few version of gdb and gcc ago) I was
> having trouble debugging an algorithm I implemented in C++ using
> templates. I do not recall the exact problems but after a few online
> searches it appeared that the easiest way was to not to use templates
> (one problem was that I has having difficulty to examine template
> variables). IIRC, gdb was not very friendly while debugging C++ code
> with templates.

This is for the STL but I think it is useful for other templates.
When I had that issue that is the best I could do for examining
template variables and I think it just works.

http://wiki.freaks-unidos.net/weblogs/arhuaco/debugging-stl-code-with-gdb

I am also interested in your experiences (I use more C than C++  now
but I guess I might use C++ once in a while).

N.-


Reply to: