GDB- doesn't stop in constructors & destructors?
Hi, I am trying to debug my application using gdb. When I try to put a breakpoint in a constructor, it says no such function. When I apply breakpoint in the particular line number, the breakpoint gets set. When I run the application, it should stop in that breakpoint before any execution; but it does not do. So my doubt is, does gdb display when breakpoints are put in the constructor? Please suggest me a way by which I would ensure that all the constructors (objects) are initialized before I run the application. Thanks in advance. Regards, Anuradha Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com immediately and destroy all copies of this message and any attachments.
I am trying to debug my application using gdb. When I try to put a breakpoint in a constructor, it says no such function. When I apply breakpoint in the particular line number, the breakpoint gets set. When I run the application, it should stop in that breakpoint before any execution; but it does not do.
So my doubt is, does gdb display when breakpoints are put in the constructor? Please suggest me a way by which I would ensure that all the constructors (objects) are initialized before I run the application. This is actually related to my earlier question that was appropriately answered. GDB will certainly insert a breakpoint in a constructor unless
On Thursday 08 December 2005 4:04 am, anuradha.vembu@wipro.com wrote: that constructor is inlined. When any code is inlined, the code is inserted into the place where the class is instantiated. -- Jerry Feldman <gaf@blu.org> Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
There's a bug in some versions of gcc/gdb that makes breakpoints in constructors not work correctly. There are actually multiple constructors generated by gcc, and gdb only puts the breakpoint in one of them. A suitable google search should access the pertinent information (which is how I found out about this). Rich On 12/8/05, anuradha.vembu@wipro.com <anuradha.vembu@wipro.com> wrote:
Hi,
I am trying to debug my application using gdb. When I try to put a breakpoint in a constructor, it says no such function. When I apply breakpoint in the particular line number, the breakpoint gets set. When I run the application, it should stop in that breakpoint before any execution; but it does not do.
So my doubt is, does gdb display when breakpoints are put in the constructor? Please suggest me a way by which I would ensure that all the constructors (objects) are initialized before I run the application.
Thanks in advance.
Regards,
Anuradha
Confidentiality Notice
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com immediately and destroy all copies of this message and any attachments.
-- Rich Wilson richaw@gmail.com 425-337-7129
On Thu, 8 Dec 2005 08:36:03 -0800 Rich Wilson <richaw@gmail.com> wrote:
There's a bug in some versions of gcc/gdb that makes breakpoints in constructors not work correctly. There are actually multiple constructors generated by gcc, and gdb only puts the breakpoint in one of them. A suitable google search should access the pertinent information (which is how I found out about this). I think that that bug existed in gdb 5.3 but was fixed in 6.0, but I'm not 100%sure -- Jerry Feldman <gaf@blu.org> Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
participants (3)
-
anuradha.vembu@wipro.com
-
Jerry Feldman
-
Rich Wilson