guessing where address belongs to

Yakov Lerner iler.ml@gmail.com
Thu Mar 6 06:54:00 GMT 2008


On Wed, Mar 5, 2008 at 9:51 PM, Michael Snyder <msnyder@specifix.com> wrote:


>
>
>
> On Tue, 2008-03-04 at 21:42 +0200, Eli Zaretskii wrote:
> > > Date: Tue, 4 Mar 2008 10:15:42 +0200
> > > From: "Yakov Lerner" <iler.ml@gmail.com>
> > >
> > > Is there command to have gdb guess which memory object this
> > > address belongs to (which function ... which stack frame .. which static
> > > object .. which head object )?
I meant "heap object"

>
>
>
> >
> > I think you want "info symbol".
>
> That will help -- if the address is associated with a symbol.
> For stack and heap pointers it's not always helpful.
>
> I don't think there is a single command to do what you want,
> but "info target" will be helpful -- it will show all loaded
> sections and their memory ranges.  You can fit the address into
> one of them (if it fits).  "info file" is an alias for this
> (I think).
>
> This shows the sections for shared libraries too, which is a plus.
>
>
> Maybe if you can mock up a spec for what it is you want,
> it wouldn't be that difficult to implement a new command
> for it...


Ok, I will try to spec it. Regarding guessing of the
"heap objects", I have this question:

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 ?

Yakov



More information about the Gdb mailing list