Hide Forgot
The actual fix may not be too easy to find, as it should be somewehere in the patches listed at https://sourceware.org/bugzilla/show_bug.cgi?id=11657#c3
Created attachment 984813 [details] simple test case
Just to make it clear, the customer wants strictly the bug described in comments 1 and 2 of the sourceware report. Unfortunately, it appears to have been corrected in a quite large cvs commit, so it may not be trivial to find what commit actually corrected it. The problem does not happen in recent fedora or rhel-7.
We investigated this bug, and the conclusion is that the patch to fix the issue is too big to be backported safely for 6.7. We cannot afford applying it and causing an obscure regression elsewhere. The fix that I proposed (suggested by Jan Kratochvil) is to replace the assertion by a warning, which would not crash GDB and therefore would not impact the debugging session. Also, it is worth mentioning that, for a more advanced debugging experience with C++, there is the DTS version of GDB.
That is removing the assertion will make the breakpoint placed only one instanced of a constructor/destructor; execution of other instances will miss the breakpoint. The warning's printing should be also limited somehow (per struct breakpoint?) otherwise it would get printed on each shared library load.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-1325.html