This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb 6.3 C++ breakpoint in constructor/destructor patch


Hello,

I want to supply a patch for the released gdb 6.3, that fixes partially the gdb bugs

gdb/1091: Constructor breakpoints ignored
gdb/1193: g++ 3.3 creates multiple constructors: gdb 5.3 can't set breakpoints


I was really confused, why my programs to not stop at the breakpoint in constructor/destructors. Now i know, it is not the fault of my programs ;) Since this anoying problem seems to be in gdb since the gcc 3.x release, i guess, no one else a) has this problem (i don't believe so) or b) will not fix it. So i did it ;)

This modification is only made for commands like "break [source]:<lineno>". For C++ constructors and destructors, the patch creates more than one breakpoint at the source at lineno, but each generated breakpoint will have another address!

NOTE: this is only a simple "hack". I have spent only one day to get into gdb source code and do the modification.
It would be better, to create only one breakpoint in such C++ constructors and destructors and assign multiple addresses to it. But this needs a huge modification of gdb, i guess ;)


ChangeLog:
2005-04-30  Thomas Maier   <balagi@justmail.de>

	* breakpoint.c linespec.c symtab.c symtab.h
	  Add better support for breakpoints in C++ constructors
	  and destructors.
	  NOTE: this is only a simple hack.
	  This modification is only made for commands like
	  "break [source]:<lineno>". It creates more than one
	  breakpoint at the source at lineno, but each
	  generated breakpoint will have another address!



For more information see also
http://people.freenet.de/BalaGi

I hope this patch is helpful, maybe some of you can do it into gdb or even use it as a base for a better patch fixing 1091 and 1193 ;)

Greetings

Thomas Maier

Attachment: patch-gdb-6.3-c++-bpconstr
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]