From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27120 invoked by alias); 24 Oct 2011 21:35:21 -0000 Received: (qmail 26976 invoked by uid 22791); 24 Oct 2011 21:35:20 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from kay.astro.Princeton.EDU (HELO mail.astro.princeton.edu) (128.112.24.221) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 24 Oct 2011 21:35:04 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astro.princeton.edu (Postfix) with ESMTP id 844AA1BC00764; Mon, 24 Oct 2011 17:35:03 -0400 (EDT) Received: from mail.astro.princeton.edu ([127.0.0.1]) by localhost (kay.astro.princeton.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id hTDJXvrPhGfq; Mon, 24 Oct 2011 17:35:03 -0400 (EDT) X-Submitted: to mail.astro.princeton.edu (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: rhl) with ESMTP; Mon, 24 Oct 2011 17:35:03 -0400 (EDT) Subject: Re: Option parsing in gdb python Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: Robert Lupton the Good In-Reply-To: <20111024212805.GP335@adacore.com> Date: Tue, 25 Oct 2011 02:58:00 -0000 Cc: gdb@sourceware.org Content-Transfer-Encoding: quoted-printable Message-Id: <755BDB90-D687-4CA4-86B6-EF1A02E7F2EE@astro.princeton.edu> References: <1319403653.11425.ezmlm@sourceware.org> <1C69408D-CEF9-4B86-A2E2-4A7547F069D9@astro.princeton.edu> <20111024212805.GP335@adacore.com> To: Joel Brobecker 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: 2011-10/txt/msg00179.txt.bz2 > The part that I don't get at the moment is how this is all going to be us= eful in general. Can you give some example of how you want to use this clas= s? Oh, sorry. I have an image class, and I want to support show image img but I also want to specify the format width, the part of the image to show,= etc. So show image -a img # print it all show image -o 10 20 img 5 5 # print the 5x5 subimage starting at (10, 20) show image -o 10 20 -c img 5 5 # print the 5x5 subimage centred at (10, 20) show image -f 4 -a img # print it all, using a field width of 4 chars That last one looks like: > (gdb) show image -f 4 -a idImage > 0 1 2 3 4 5 6 7 8 9 10 11=20 > 7 0x0 0x0 0x0 0x3 0x0 0x0 0x0 0x0 0x2 0x2 0x0 0x0=20 > 6 0x0 0x0 0x3 0x3 0x3 0x0 0x0 0x2 0x2 0x2 0x2 0x0=20 > 5 0x0 0x0 0x0 0x3 0x0 0x0 0x2 0x2 0x2 0x2 0x2 0x2=20 > 4 0x0 0x0 0x0 0x0 0x1 0x0 0x0 0x2 0x2 0x0 0x2 0x0=20 > 3 0x0 0x0 0x0 0x1 0x1 0x1 0x0 0x0 0x0 0x0 0x0 0x0=20 > 2 0x0 0x0 0x1 0x1 0x1 0x1 0x1 0x0 0x0 0x0 0x0 0x0=20 > 1 0x0 0x0 0x0 0x1 0x1 0x1 0x0 0x0 0x0 0x0 0x0 0x0=20 > 0 0x0 0x0 0x0 0x0 0x1 0x0 0x0 0x0 0x0 0x0 0x0 0x0=20 I also have similar needs for eigen::Matrix, and ... So I call GdbArgumentParse in the invoke method of a subclass of gdb.Comman= d. R