From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20292 invoked by alias); 6 Feb 2003 23:31:57 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 20284 invoked from network); 6 Feb 2003 23:31:55 -0000 Received: from unknown (HELO zenia.red-bean.com) (66.244.67.22) by 172.16.49.205 with SMTP; 6 Feb 2003 23:31:55 -0000 Received: from zenia.red-bean.com (localhost.localdomain [127.0.0.1]) by zenia.red-bean.com (8.12.5/8.12.5) with ESMTP id h16NNL8A029121; Thu, 6 Feb 2003 18:23:22 -0500 Received: (from jimb@localhost) by zenia.red-bean.com (8.12.5/8.12.5/Submit) id h16NNKGr029117; Thu, 6 Feb 2003 18:23:20 -0500 To: William Trenker Cc: gdb@sources.redhat.com Subject: Re: How Do I see (Disabled) data? References: <20030206104718.24775823.wdtrenker@yahoo.ca> <20030206115126.58b8e0fc.wdtrenker@yahoo.ca> From: Jim Blandy Date: Thu, 06 Feb 2003 23:31:00 -0000 In-Reply-To: <20030206115126.58b8e0fc.wdtrenker@yahoo.ca> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.92 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-02/txt/msg00142.txt.bz2 William Trenker writes: > On 06 Feb 2003 14:25:59 -0500 > Jim Blandy wrote: > > > Can you show us the exact commands you're using, and the exact output > > from GDB? > > The exact gdb commands, below, are actually generated by DDD: > > (gdb) graph display buff > (gdb) graph display *buff dependent on 1 > (gdb) Attempt to dereference a generic pointer. > Disabling display 2 to avoid infinite recursion. > > buff is defined in the code as: > buff = (void *)param->get_string(); > > I should mention that I've experimented some more since my first message. I got adventurous with gdb's print command and found out I could explicitly cast the variable, like this: > > (gdb) print (char*)buff > $1 = 0x8060a40 "Alex" > > I think I may have answered my own question -- right? Yep. GDB isn't sure how to evaluate *p, when p has type 'void *', so the 'display' gets an error, and GDB disables it. By casting it, you effectively tell GDB which type to use to display it.