This is the mail archive of the gdb@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]

Re: malloc() debugging


On Wed, 30 Oct 2002, Fredrik Tolf wrote:

> Shouldn't gdb be enabled to do this in that case?

You cannot do that in a general manner; see below.

> Speaking of which, can't gdb create watchpoints to these structuress 
> every time malloc is called with conditions of $pc outside the malloc 
> functions and delete them when free is called?

That might work (barring the problem with limited watchpoint resources), 
but the showstopper is that you need an intimate knowledge about the C 
library's implementation of malloc, and you need to make sure the program 
was linked against a version of the library where debug info wasn't 
stripped.


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