From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25192 invoked by alias); 10 Sep 2010 14:41:43 -0000 Received: (qmail 25182 invoked by uid 22791); 10 Sep 2010 14:41:43 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-ew0-f41.google.com (HELO mail-ew0-f41.google.com) (209.85.215.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Sep 2010 14:41:37 +0000 Received: by ewy28 with SMTP id 28so2038169ewy.0 for ; Fri, 10 Sep 2010 07:41:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.28.205 with SMTP id n13mr53770ebc.5.1284129694353; Fri, 10 Sep 2010 07:41:34 -0700 (PDT) Received: by 10.14.121.13 with HTTP; Fri, 10 Sep 2010 07:41:34 -0700 (PDT) Date: Fri, 10 Sep 2010 14:41:00 -0000 Message-ID: Subject: user defined function and passing types From: Pawel K To: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2010-09/txt/msg00063.txt.bz2 Hallo Group Members. I have following user defined function: define my_stl_list =A0 set $list =3D ($arg0) =A0 set $list_size =3D 0 =A0 set $firstNode =3D $list._M_head =A0 set $curNode =3D $list._M_head._M_next =A0 while ($curNode !=3D 0) =A0=A0=A0 printf "List Element %d: ", $list_size =A0=A0=A0 p ((const __gnu_cxx::_Slist_node *)$curNode)->_M_data =A0=A0=A0 set $curNode =3D ($curNode)->_M_next =A0=A0=A0 set $list_size++ =A0 end end As You can see, it displays contents of slist. It's drawback is that it has hard coded type of list (const __gnu_cxx::_Slist_node *). Is there a way to pass it as parameter to this macro? best regards, Pawel