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: calling glibc mallinfo() from GDB after attaching to a process?


Ed,

call mallinfo

(warning - gdb rookie here - although I have the manual open on my lap...)


I get in response to this:

[...]
(gdb) break main
Breakpoint 1 at 0x80484d8: file malloc.c, line 12.
(gdb) run
Starting program: /home/cmarkle/src/x
Breakpoint 1, main (argc=1, argv=0xbffebf54) at malloc.c:12
12              malloc(10000);
(gdb) n
13              malloc(100000);
(gdb) n
14              malloc(1000000);
(gdb) call mallinfo
$1 = {<text variable, no debug info>} 0x400a4b30 <__libc_mallinfo>

Supposedly mallinfo() returns a 40-byte mallinfo structure. How do I get that structure returned and how do I display it?

Thx in advance...

Chris





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