From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25472 invoked by alias); 6 Mar 2008 06:04:22 -0000 Received: (qmail 25463 invoked by uid 22791); 6 Mar 2008 06:04:20 -0000 X-Spam-Check-By: sourceware.org Received: from wf-out-1314.google.com (HELO wf-out-1314.google.com) (209.85.200.168) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 06 Mar 2008 06:04:03 +0000 Received: by wf-out-1314.google.com with SMTP id 29so2231807wff.24 for ; Wed, 05 Mar 2008 22:04:01 -0800 (PST) Received: by 10.142.48.14 with SMTP id v14mr1109427wfv.14.1204783441872; Wed, 05 Mar 2008 22:04:01 -0800 (PST) Received: by 10.143.125.5 with HTTP; Wed, 5 Mar 2008 22:04:01 -0800 (PST) Message-ID: Date: Thu, 06 Mar 2008 06:54:00 -0000 From: "Yakov Lerner" To: gdb@sourceware.org Subject: Re: guessing where address belongs to In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1204746687.19253.610.camel@localhost.localdomain> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-03/txt/msg00058.txt.bz2 On Wed, Mar 5, 2008 at 9:51 PM, Michael Snyder 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" > > > > > > 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