gdb breakpoint issue with C++ templates

A

Ajay 0x007

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
 
V

Victor Bazarov

Ajay said:
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
 
A

Ajay 0x007

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 @ (e-mail address removed)
 
J

jacob navia

Ajay said:
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 @ (e-mail address removed)

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.
 
J

James Kanze

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).
 
R

red floyd

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 @ (e-mail address removed)

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

jacob navia

Ajay said:
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.
 
A

Ajay 0x007

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.
 
J

Jorgen Grahn

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top