From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25007 invoked by alias); 15 May 2009 14:07:31 -0000 Received: (qmail 24993 invoked by uid 22791); 15 May 2009 14:07:30 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 15 May 2009 14:07:23 +0000 Received: from zps36.corp.google.com (zps36.corp.google.com [172.25.146.36]) by smtp-out.google.com with ESMTP id n4FE7Jvj009318 for ; Fri, 15 May 2009 15:07:19 +0100 Received: from qyk29 (qyk29.prod.google.com [10.241.83.157]) by zps36.corp.google.com with ESMTP id n4FE7AH1019446 for ; Fri, 15 May 2009 07:07:17 -0700 Received: by qyk29 with SMTP id 29so3440384qyk.15 for ; Fri, 15 May 2009 07:07:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.100.9 with SMTP id w9mr2092027qcn.31.1242396436689; Fri, 15 May 2009 07:07:16 -0700 (PDT) In-Reply-To: <83preargj6.fsf@gnu.org> References: <8ac60eac0905141617g1db278e5l906eef8f5b899ed4@mail.gmail.com> <83preargj6.fsf@gnu.org> Date: Fri, 15 May 2009 14:07:00 -0000 Message-ID: <8ac60eac0905150707n38e82ebcw49a4f46d476ef7f@mail.gmail.com> Subject: Re: overloading 'print' command. From: Paul Pluzhnikov To: Eli Zaretskii Cc: pluto@agmk.net, gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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: 2009-05/txt/msg00082.txt.bz2 2009/5/15 Eli Zaretskii : >> Date: Thu, 14 May 2009 16:17:07 -0700 >> From: Paul Pluzhnikov >> 2009/5/14 Pawe=B3 Sikora : ... >> > Is it possible in gdb to register some hooks for >> > type-based printing? ^^^^^^^^^^^^^^^^^^^^^^^^^ >> Support for doing *exactly* this is coming to mainline GDB, but you can >> get it now from the archer-tromey-python branch: >> =A0 http://sourceware.org/gdb/wiki/PythonGdb > > But I think what the OP wants does not justify waiting a few months > until GDB 7 is released. He can get it now from the archer branch. > To the OP: yes, you should be able to use the user-defined hooks > machinery to do what you want. I don't see how hook-print can help OP to do something special for std::string. The manual says hook-print doesn't get any arguments, so it can't even tell what is being printed. What am I missing? Cheers, --=20 Paul Pluzhnikov