From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31240 invoked by alias); 25 May 2004 16:55:49 -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 31231 invoked from network); 25 May 2004 16:55:47 -0000 Received: from unknown (HELO mailhost.cas.org) (134.243.50.9) by sourceware.org with SMTP; 25 May 2004 16:55:47 -0000 Received: from cas.org (pmd24awu [134.243.216.44]) by mailhost.cas.org (8.12.10/8.12.10/CAS_MAIL_HUB-4.6) with ESMTP id i4PGtkIQ013004 for ; Tue, 25 May 2004 12:55:46 -0400 (EDT) (envelope-from pdubuc@cas.org) Message-ID: <40B37A92.6020106@cas.org> Date: Tue, 25 May 2004 16:55:00 -0000 From: Paul Dubuc Organization: Chemical Abstracts Service (CAS) User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020920 Netscape/7.0 MIME-Version: 1.0 To: GDB Mailing List Subject: Taking the address of a convenience variable value Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-05/txt/msg00164.txt.bz2 In the June 2004 issue of the C/C++ User's Journal (p. 24) there is an article on how to write user-defined commands for gdb to examine the contents of STL vectors, sets and maps. It looks extremely useful, so I decided to try it modifying the commands for use with the GCC STL, but I can't get some of the commands for sets and maps to work. It relies on a tecnique that involves being able to take the address of a convenience variable value, for example: set $maptype = &$arg0._M_t._M_header->_M_value_field set $maptypep = &$maptype When I try this the 2nd statement gives me the error message Attempt to take address of value not located in memory. It doesn't work with gdb 5.3 or 6.1 on Solaris. The author claims that it works on HP-UX, but I don't know why it would be any different. Is there a way around this? Or is there another source of user-defined commands that can be used to print the contents of STL containers in gdb? Any help would be very much appreciated. Thanks, Paul Dubuc