From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26793 invoked by alias); 6 Mar 2008 20:28:34 -0000 Received: (qmail 26785 invoked by uid 22791); 6 Mar 2008 20:28:34 -0000 X-Spam-Check-By: sourceware.org Received: from bluesmobile.specifix.com (HELO bluesmobile.specifix.com) (216.129.118.140) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 06 Mar 2008 20:28:13 +0000 Received: from [127.0.0.1] (bluesmobile.specifix.com [216.129.118.140]) by bluesmobile.specifix.com (Postfix) with ESMTP id 3640B3C54E; Thu, 6 Mar 2008 12:28:12 -0800 (PST) Subject: Re: guessing where address belongs to From: Michael Snyder To: Yakov Lerner Cc: Andreas Schwab , gdb@sourceware.org In-Reply-To: References: <1204746687.19253.610.camel@localhost.localdomain> Content-Type: text/plain Date: Thu, 06 Mar 2008 20:37:00 -0000 Message-Id: <1204835291.19253.691.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-7.fc7) Content-Transfer-Encoding: 7bit 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/msg00081.txt.bz2 On Thu, 2008-03-06 at 12:45 +0200, Yakov Lerner wrote: > On Thu, Mar 6, 2008 at 12:05 PM, Andreas Schwab wrote: > > "Yakov Lerner" 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. > > You don't need details of malloc guts for that. > > It's enough to hook to the entry and return from malloc,free,realloc. Yep, and there are tools that do that -- but gdb isn't one of them. OTOH, it would be possible to set user breakpoints at malloc and free, and then write user gdb commands to collect whatever information you want...