This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: guessing where address belongs to
On Thu, 2008-03-06 at 11:05 +0100, Andreas Schwab wrote:
> "Yakov Lerner" <iler.ml@gmail.com> writes:
>
> > Gdb has no integration with malloc, correct ?
> > Gdb has no way of enumerating all malloced
> > pieces ("heap objects"), correct ?
> >
> > Or gdb does have a way of guessing which "heap
> > object" some address X (that points inside the heap) belongs to ?
>
> The details are highly dependent on the malloc implementation. There is
> no way to find that out without intimate knowledge of the
> implementation.
Yep, and there's no marriage between any given platform
and any given malloc implementation. Replacing the malloc
from glibc is a fairly common thing to do, for instance.
So gdb really has no idea what's in there...