gdb breakpoint issue with C++ templates

Discussion in 'C++' started by Ajay 0x007, Jul 14, 2009.

  1. Ajay 0x007

    Ajay 0x007 Guest

    Hi

    While debugging ina templated class, when I put a breakpoint using
    file_name:line_number
    syntax, my simulation does not hit the breakpoint.

    So to avoid that problem, I provided complete exact template
    arguments while putting the breakpoint, i.e.
    class_name<T1, T2, T3>::func_name(arg1, arg2)

    and it start working as expected (start hitting the function)

    But I am still not able to put a breakpoint on a line number, Can
    somebody provied me the syntax.

    I am using gcc 3.2.3 and gdb v GNU gdb Red Hat Linux
    (6.3.0.0-1.138.el3rh)

    Regards
    Ajay 0x007, Jul 14, 2009
    #1
    1. Advertising

  2. Ajay 0x007 wrote:
    > While debugging ina templated class, when I put a breakpoint using
    > file_name:line_number
    > syntax, my simulation does not hit the breakpoint.
    >
    > So to avoid that problem, I provided complete exact template
    > arguments while putting the breakpoint, i.e.
    > class_name<T1, T2, T3>::func_name(arg1, arg2)
    >
    > and it start working as expected (start hitting the function)
    >
    > But I am still not able to put a breakpoint on a line number, Can
    > somebody provied me the syntax.
    >
    > I am using gcc 3.2.3 and gdb v GNU gdb Red Hat Linux
    > (6.3.0.0-1.138.el3rh)


    Please ask about tools and utilities in 'gnu.utils.help' or maybe
    'gnu.gdb.bug' (at least they talk gdb). Here we talk C++ *language* and
    not tools or how to use them.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
    Victor Bazarov, Jul 14, 2009
    #2
    1. Advertising

  3. Ajay 0x007

    Ajay 0x007 Guest

    On Jul 14, 7:36 pm, Victor Bazarov <> wrote:
    > Ajay 0x007 wrote:
    > > While debugging ina templated class, when I put a breakpoint using
    > > file_name:line_number
    > > syntax, my simulation does not hit the breakpoint.

    >
    > > So to avoid that problem,  I provided complete exact template
    > > arguments while putting the breakpoint, i.e.
    > > class_name<T1, T2, T3>::func_name(arg1, arg2)

    >
    > > and it start working as expected (start hitting the function)

    >
    > > But I am still not able to put a breakpoint on a line number, Can
    > > somebody provied me the syntax.

    >
    > > I am using gcc 3.2.3 and gdb v GNU gdb Red Hat Linux
    > > (6.3.0.0-1.138.el3rh)

    >
    > Please ask about tools and utilities in 'gnu.utils.help' or maybe
    > 'gnu.gdb.bug' (at least they talk gdb).  Here we talk C++ *language* and
    > not tools or how to use them.
    >
    > V
    > --
    > Please remove capital 'A's when replying by e-mail
    > I do not respond to top-posted replies, please don't ask- Hide quoted text -
    >
    > - Show quoted text -


    I posted same query on that forum but nobody seam to be replying.
    I apologize for spamming but its really urgent for me so if anybody
    have any idea regarding the sam please mail me @
    Ajay 0x007, Jul 14, 2009
    #3
  4. Ajay 0x007

    jacob navia Guest

    Ajay 0x007 wrote:
    > On Jul 14, 7:36 pm, Victor Bazarov <> wrote:
    >> Ajay 0x007 wrote:
    >>> While debugging ina templated class, when I put a breakpoint using
    >>> file_name:line_number
    >>> syntax, my simulation does not hit the breakpoint.
    >>> So to avoid that problem, I provided complete exact template
    >>> arguments while putting the breakpoint, i.e.
    >>> class_name<T1, T2, T3>::func_name(arg1, arg2)
    >>> and it start working as expected (start hitting the function)
    >>> But I am still not able to put a breakpoint on a line number, Can
    >>> somebody provied me the syntax.
    >>> I am using gcc 3.2.3 and gdb v GNU gdb Red Hat Linux
    >>> (6.3.0.0-1.138.el3rh)

    >> Please ask about tools and utilities in 'gnu.utils.help' or maybe
    >> 'gnu.gdb.bug' (at least they talk gdb). Here we talk C++ *language* and
    >> not tools or how to use them.
    >>
    >> V
    >> --
    >> Please remove capital 'A's when replying by e-mail
    >> I do not respond to top-posted replies, please don't ask- Hide quoted text -
    >>
    >> - Show quoted text -

    >
    > I posted same query on that forum but nobody seam to be replying.
    > I apologize for spamming but its really urgent for me so if anybody
    > have any idea regarding the sam please mail me @


    In general all the groups of the gnu.*.* type are almost inactive. The
    only posts I see are people asking questions, but there is never
    any answer. Maybe because:

    11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
    WARRANTY FOR THE PROGRAM,
    [snip]
    THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH
    YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
    NECESSARY SERVICING, REPAIR OR CORRECTION.
    jacob navia, Jul 14, 2009
    #4
  5. Ajay 0x007

    James Kanze Guest

    On Jul 14, 6:03 pm, jacob navia <> wrote:
    > Ajay 0x007 wrote:
    > > On Jul 14, 7:36 pm, Victor Bazarov <> wrote:
    > >> Ajay 0x007 wrote:
    > >>> While debugging ina templated class, when I put a breakpoint using
    > >>> file_name:line_number
    > >>> syntax, my simulation does not hit the breakpoint.
    > >>> So to avoid that problem, I provided complete exact template
    > >>> arguments while putting the breakpoint, i.e.
    > >>> class_name<T1, T2, T3>::func_name(arg1, arg2)
    > >>> and it start working as expected (start hitting the function)
    > >>> But I am still not able to put a breakpoint on a line number, Can
    > >>> somebody provied me the syntax.
    > >>> I am using gcc 3.2.3 and gdb v GNU gdb Red Hat Linux
    > >>> (6.3.0.0-1.138.el3rh)
    > >> Please ask about tools and utilities in 'gnu.utils.help' or maybe
    > >> 'gnu.gdb.bug' (at least they talk gdb). Here we talk C++ *language* and
    > >> not tools or how to use them.


    > > I posted same query on that forum but nobody seam to be replying.
    > > I apologize for spamming but its really urgent for me so if anybody
    > > have any idea regarding the sam please mail me @


    > In general all the groups of the gnu.*.* type are almost inactive. The
    > only posts I see are people asking questions, but there is never
    > any answer. Maybe because:


    > 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
    > WARRANTY FOR THE PROGRAM,
    > [snip]
    > THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH
    > YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
    > NECESSARY SERVICING, REPAIR OR CORRECTION.


    Or maybe simply because they've shifted their support to mailing
    lists. I don't know about gdb, but I've always gotten prompt
    and helpful answers from most of the other mailing lists (e.g.
    GNU make).

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
    James Kanze, Jul 14, 2009
    #5
  6. Ajay 0x007

    red floyd Guest

    On Jul 14, 8:56 am, Ajay 0x007 <> wrote:

    > I posted same query on that forum but nobody seam to be replying.
    > I apologize for spamming but its really urgent for me so if anybody
    > have any idea regarding the sam please mail me @


    I had a question about my car, but the mechanic shop was closed, so I
    asked
    my greengrocer instead.
    red floyd, Jul 14, 2009
    #6
  7. Ajay 0x007

    jacob navia Guest

    Ajay 0x007 wrote:
    > Hi
    >
    > While debugging ina templated class, when I put a breakpoint using
    > file_name:line_number
    > syntax, my simulation does not hit the breakpoint.
    >
    > So to avoid that problem, I provided complete exact template
    > arguments while putting the breakpoint, i.e.
    > class_name<T1, T2, T3>::func_name(arg1, arg2)
    >
    > and it start working as expected (start hitting the function)
    >
    > But I am still not able to put a breakpoint on a line number, Can
    > somebody provied me the syntax.
    >
    > I am using gcc 3.2.3 and gdb v GNU gdb Red Hat Linux
    > (6.3.0.0-1.138.el3rh)
    >
    > Regards
    >


    Are you using optimizations?
    gdb has this kind of behavior when optimizations are turned on.

    Your syntax is correct (file:line), but you should be surethat there is
    code around that line. For instance, try to put a breakpoint one line
    further down or up and see if that works.

    In most of the cases the optimizer screws completely the code so that
    the debugger gets lost. I have followed some discussions in the gcc
    group of a guy that wanted to implement better debug information
    generation when optimizing but he never got much support. This part
    of the system looks very bad indeed.
    jacob navia, Jul 14, 2009
    #7
  8. Ajay 0x007

    Ajay 0x007 Guest

    On Jul 14, 9:37 pm, red floyd <> wrote:
    > On Jul 14, 8:56 am, Ajay 0x007 <> wrote:
    >
    > > I posted same query on that forum but nobody seam to be replying.
    > > I apologize for spamming but its really urgent for me so if anybody
    > > have any idea regarding the sam please mail me @

    >
    > I had a question about my car, but the mechanic shop was closed, so I
    > asked
    > my greengrocer instead.


    Thanks for such nice answers. Anyways new gdb version (v 6.8) solves
    this issue.

    P.S. @ red floyd Now will you consider as myself providing information
    about my car to my greengrocer.
    Ajay 0x007, Jul 15, 2009
    #8
  9. Ajay 0x007

    Jorgen Grahn Guest

    On Tue, 14 Jul 2009 09:37:44 -0700 (PDT), red floyd <> wrote:
    > On Jul 14, 8:56 am, Ajay 0x007 <> wrote:
    >
    >> I posted same query on that forum but nobody seam to be replying.
    >> I apologize for spamming but its really urgent for me so if anybody
    >> have any idea regarding the sam please mail me @

    >
    > I had a question about my car, but the mechanic shop was closed, so I
    > asked my greengrocer instead.


    .... who you know spends a lot of time tinkering with cars, and is likely
    to drive the same brand as you. To complete the metaphor.

    /Jorgen

    --
    // Jorgen Grahn <grahn@ Oo o. . .
    \X/ snipabacken.se> O o .
    Jorgen Grahn, Jul 20, 2009
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark
    Replies:
    4
    Views:
    344
    Rick Spiewak
    Apr 26, 2004
  2. Surendra
    Replies:
    0
    Views:
    491
    Surendra
    Mar 23, 2006
  3. Pawel
    Replies:
    1
    Views:
    1,411
    Ian Collins
    Oct 26, 2006
  4. seba
    Replies:
    1
    Views:
    1,421
    mlimber
    Mar 22, 2007
  5. Timothy Madden
    Replies:
    1
    Views:
    1,583
    Timothy Madden
    Sep 17, 2009
Loading...

Share This Page