public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "Aurelian Melinte" <ame01@gmx.net>
To: xgsa <xgsa@yandex.ru>, structurechart@yahoo.com
Cc: gdb@sourceware.org
Subject: Re: Memory Dump
Date: Thu, 03 May 2012 14:17:00 -0000	[thread overview]
Message-ID: <20120503141701.57320@gmx.net> (raw)
In-Reply-To: <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

  reply	other threads:[~2012-05-03 14:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-29 14:40 Hei Chan
2012-05-03  6:56 ` xgsa
2012-05-03 14:17   ` Aurelian Melinte [this message]
2012-05-03 19:23   ` Philippe Waroquiers
2012-05-06  0:55     ` Hei Chan
2012-05-06  7:49       ` Philippe Waroquiers
2012-05-06  0:43   ` Hei Chan
2012-05-09 20:25 ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120503141701.57320@gmx.net \
    --to=ame01@gmx.net \
    --cc=gdb@sourceware.org \
    --cc=structurechart@yahoo.com \
    --cc=xgsa@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).