This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: calling glibc mallinfo() from GDB after attaching to a process?
- From: "Eli Zaretskii" <eliz at gnu dot org>
- To: Chris Markle <cmarkle at sendmail dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Tue, 31 Aug 2004 06:57:21 +0300
- Subject: Re: calling glibc mallinfo() from GDB after attaching to a process?
- References: <4133DDC2.3040403@sendmail.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Mon, 30 Aug 2004 19:09:06 -0700
> From: Chris Markle <cmarkle@sendmail.com>
>
> I would like to attach to a running program, issue a call to the glibc
> mallinfo() function, display the returned mallinfo structure, and the
> continue execution of the program. The idea here is to grab some malloc
> statistics from a running program... Is this kind of thing possible?
Yes.
> If so, can someone offer up some clues as to the GDB commands to
> issue to do this?
After attaching to the program, use the command
call mallinfo
to call the function. This will work if mallinfo is linked into the
program.