Hi Atul,
Yes, dependencies got messed up when you change the includes of a file because Makefile does not get rebuilt. It is necessary to run qmake again to create an up-to-date Makefile.
Regarding gdb not respecting breakpoints, that’s an old gdb bug (maybe 2 or three years old). I even looked into it once. The problem is that after some version of gcc, I don’t remember which one, the compiler creates multiple versions of each ctor. The demangled names are of course the same. That was to comply some inter-vendor agreement on how virtual base classes get implemented. I remember I read how to get all symbols listed and really there were two or three versions for each ctor. Then I put a breakpoint on the symbol’s starting address and that worked.
The thing is that gdb puts a breakpoint only in on of the versions of the ctor and unluckily that’s the wrong one. I looked into gdb source and it turns out they had in mind the possibility to have multiple break locations per breakpoint but that has never been implemented. Actually most of their structures can be used as linked lists but the breakpoint address structure (I don’t remember the exact name anymore) was not used like this. I think it is possible to fix this nasty bug in an elegant way but I never found any time to look into the details of an implementation. That would be a nice challenge though!
Best regards,
Peter
atul wrote:Could be my failing ( as I introduced a new header - BadPacket.h — ) and did not run qmake…
but still the code was should still have worked ( as it compiled and linked fine …. BadPacket is in include path and all methods being inline ).
Maybe I will give it a check at some later point …
– cheers atul
atul wrote:
Dear all
While refactoring Gnutella/Packets/Packet and friends I made changes and gave it a go…
Somehow it started crashing mysteriously.. ( Data d member of Packet was not getting set ).. I reasoned about it but could not see how that could happen ( as every ctor carefully initializes d = new Data… )
I put a breakpoint in gdb but somehow gdb was not able to stop there ( the breakpoint was simply not effective )
Then to make sure I gave a make clean and then a make and things fell in place ( I ensured by running thru valgrind — as uninitialized vars can assume legal values ;-)
Have any of you seen this before….
— cheers atul
