This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: malloc() debugging
- From: Eli Zaretskii <eliz at is dot elta dot co dot il>
- To: Fredrik Tolf <fredrik at dolda2000 dot cjb dot net>
- Cc: Daniel Jacobowitz <drow at mvista dot com>, gdb at sources dot redhat dot com
- Date: Thu, 31 Oct 2002 08:05:08 +0200 (IST)
- Subject: 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.