From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2239 invoked by alias); 9 Mar 2010 05:17:13 -0000 Received: (qmail 2225 invoked by uid 22791); 9 Mar 2010 05:17:12 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 09 Mar 2010 05:17:09 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 753DA2BAB4E; Tue, 9 Mar 2010 00:17:07 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ey50NYyFH4z8; Tue, 9 Mar 2010 00:17:07 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id DFDD32BAB4B; Tue, 9 Mar 2010 00:17:06 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 5472EF5894; Tue, 9 Mar 2010 09:16:51 +0400 (RET) Date: Tue, 09 Mar 2010 05:17:00 -0000 From: Joel Brobecker To: Pierre Muller Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] avoid GDB crash on inspection of pascal arrays Message-ID: <20100309051651.GM3081@adacore.com> References: <001801cabee0$31499ca0$93dcd5e0$@muller@ics-cnrs.unistra.fr> <20100308185450.GK3081@adacore.com> <001201cabf17$43e1b960$cba52c20$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001201cabf17$43e1b960$cba52c20$@muller@ics-cnrs.unistra.fr> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00348.txt.bz2 > Formatting with the tab/spaces conversion is still a nightmare > for me... (you could get me started on a rambling about the rid^H^H^Huse of tabs instead of spaces in our source code - I just can't get over these tabs) > I really don't know vi enough to reformat correctly an almost 100 > lines long block... Is there a neat way to do this just with vi > or do I need something more powerful? I think that the canonical tool for formatting is emacs. Each time I mentioned the idea of getting rid of tabs, some said that the formatting rules need to match what emacs does. For a GNU project, it's probably fair. Unfortunately, I don't remember emacs anymore. There has to be an equivalent way in vim (auto-formatting with a single command), but I don't know, so here is how I do it with vim: 1. Get rid of all tabs first, they get in the way of selecting the columns I want to delete or add: :set expandtab select all the lines I want to reformat (shift-v) while the selection is still active, enter :'<,'>retab! (the '<,'> should appear automatically after you pressed :) 2. Delete the columns you want to delete: select the rectangle you want to delete (ctrl-v) while the selection is active, press d 3. Re-introduce the tabs: :set noexpandtab re-select all the lines to be tabified (shift-v) while the selection is active, enter: :'<,'>retab! Attached is a couple of patches: p-valprint-reformat.diff: The reformat itself; p-valprint-reformat-w: The same diff, but with -w, to show that there were no other real change except the removal of the curly braces. Can you test p-valprint-reformat.diff and then commit if it's OK? Cheers, -- Joel