This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Memory Dump
- From: "Aurelian Melinte" <ame01 at gmx dot net>
- To: xgsa <xgsa at yandex dot ru>, structurechart at yahoo dot com
- Cc: gdb at sourceware dot org
- Date: Thu, 03 May 2012 16:17:01 +0200
- Subject: Re: Memory Dump
- References: <1335710405.38804.YahooMailNeo@web162403.mail.bf1.yahoo.com> <4FA22BFD.1060600@yandex.ru>
> Hi,
>
> I am not sure, but it seems massif (the tool from the valgrind
> toolchain) could help you.
>
> P.S. However the question is still interesting - is there a possibility
> to solve the problem with gdb? Could someone answer it?
The only way I know is to write an interposition library to hook malloc()/memalign()/realloc()/free()/mmap()/munmap()/sbrk() and maybe more.
An easier alternative might be mcheck() - depending what exactly you are looking for.
Otherwise, wrap malloc() and friends within your own functions (xmalloc()) and use only these inside your program, etc.
Regards,
a.
>
> Anton.
>
> -------- Original message --------
> >
> > Hi,
> >
> > I wonder whether it is possible to dump all the objects created in the
> memory at the moment with GDB (I am on v7.0.1).
> >
> > What I am trying to achieve is to identify which types of objects take
> up most of the memory at the moment.
> >
> > Valgrind doesn't catch it and so I believe that it is some logical bug
> in my code that keeps creating the objects and free all of them at the end
> (i.e. program terminated).
> >
> > Thanks in advance.
> >
> >
> > Cheers,
> > Hei
> >
> >
>
>
--
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!
Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a