Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - breakpoints in constructors: (6 Items)
   
breakpoints in constructors  
Hi,

a customer mentioned to me that breakpoints in constructors do not work. Is this true (haven't tried to reproduce it, 
yet). Is there a fix?


- Malte
Post Deleted
Re: breakpoints in constructors  
Malte Mundt wrote:
> Hi,
> 
> a customer mentioned to me that breakpoints in constructors do not work. Is this true (haven't tried to reproduce it, 
yet). Is there a fix?

This is true sometimes in C++ generated by gcc 3.x and newer. In the new 
C++ ABI,  gcc generates two copies of the constructor, one in-charge and 
one not-in-charge. When you set a breakpoint in the ctor, gdb sets the 
breakpoint in the closest one. In some cases this will not be the ctor 
that gets executed. I believe there have been some changes done in the 
upstream gdb (6.8 or newer) that sets breakpoints in both constructors 
and resolves the issue.

Regards,

Ryan Mansfield
Re: breakpoints in constructors  
class Charles : public ScottBaio {
	Charles( Network *network, Slot *slot, Plot *plot = NULL );
}

Oddly, the "Charles Not In Charge" spinoff was not the hit of it's more able predecessor.

:-)

Ryan Mansfield wrote:
> Malte Mundt wrote:
>> Hi,
>>
>> a customer mentioned to me that breakpoints in constructors do not work. Is this true (haven't tried to reproduce it,
 yet). Is there a fix?
> 
> This is true sometimes in C++ generated by gcc 3.x and newer. In the new 
> C++ ABI,  gcc generates two copies of the constructor, one in-charge and 
> one not-in-charge. When you set a breakpoint in the ctor, gdb sets the 
> breakpoint in the closest one. In some cases this will not be the ctor 
> that gets executed. I believe there have been some changes done in the 
> upstream gdb (6.8 or newer) that sets breakpoints in both constructors 
> and resolves the issue.
> 
> Regards,
> 
> Ryan Mansfield
> 
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post17636
> 

-- 
cburgess@qnx.com
Re: breakpoints in constructors  
1) Will the gdb 6.8 be in 6.4.1 ?

2) Why are there two constructors if only one gets executed anyway? 


- Malte
Re: breakpoints in constructors  
Malte Mundt wrote:
> 1) Will the gdb 6.8 be in 6.4.1 ?

Yes. We will also be making it available on the foundry before the 
release of 6.4.1.

> 2) Why are there two constructors if only one gets executed anyway? 

They have different behavior with respect to virtual base classes.

Regards,

Ryan Mansfield