Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > gdb breakpoint issue with C++ templates

Reply
Thread Tools

gdb breakpoint issue with C++ templates

 
 
Ajay 0x007
Guest
Posts: n/a
 
      07-14-2009
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

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      07-14-2009
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
 
Reply With Quote
 
 
 
 
Ajay 0x007
Guest
Posts: n/a
 
      07-14-2009
On Jul 14, 7:36*pm, Victor Bazarov <v.Abaza...@comAcast.net> 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 @
 
Reply With Quote
 
jacob navia
Guest
Posts: n/a
 
      07-14-2009
Ajay 0x007 wrote:
> On Jul 14, 7:36 pm, Victor Bazarov <v.Abaza...@comAcast.net> 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.
 
Reply With Quote
 
James Kanze
Guest
Posts: n/a
 
      07-14-2009
On Jul 14, 6:03 pm, jacob navia <ja...@nospam.org> wrote:
> Ajay 0x007 wrote:
> > On Jul 14, 7:36 pm, Victor Bazarov <v.Abaza...@comAcast.net> 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 @ ajay.0x...@gmail.com


> 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
 
Reply With Quote
 
red floyd
Guest
Posts: n/a
 
      07-14-2009
On Jul 14, 8:56*am, Ajay 0x007 <ajay.0x...@gmail.com> 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 @ ajay.0x...@gmail.com


I had a question about my car, but the mechanic shop was closed, so I
asked
my greengrocer instead.
 
Reply With Quote
 
jacob navia
Guest
Posts: n/a
 
      07-14-2009
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.
 
Reply With Quote
 
Ajay 0x007
Guest
Posts: n/a
 
      07-15-2009
On Jul 14, 9:37*pm, red floyd <redfl...@gmail.com> wrote:
> On Jul 14, 8:56*am, Ajay 0x007 <ajay.0x...@gmail.com> 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 @ ajay.0x...@gmail.com

>
> 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. solves
this issue.

P.S. @ red floyd Now will you consider as myself providing information
about my car to my greengrocer.
 
Reply With Quote
 
Jorgen Grahn
Guest
Posts: n/a
 
      07-20-2009
On Tue, 14 Jul 2009 09:37:44 -0700 (PDT), red floyd <> wrote:
> On Jul 14, 8:56*am, Ajay 0x007 <ajay.0x...@gmail.com> 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 @ ajay.0x...@gmail.com

>
> 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 .
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Debugging with gdb: pystack macro for gdb to show python stack trace Timothy Madden Python 1 09-17-2009 11:47 AM
GDB - no debugging symbols found (GDB Vs GCC?) seba C++ 1 03-22-2007 02:02 PM
gdb: breakpoint condition to compare string Pawel C Programming 1 10-26-2006 08:38 AM
Capturing gdb output in pyhton script using gdb -batch -x arguments Surendra Python 0 03-23-2006 02:47 PM
project stops at imaginary breakpoint, but no breakpoint exists Mark ASP .Net 4 04-26-2004 04:23 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57