From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21464 invoked by alias); 29 Jun 2008 19:42:38 -0000 Received: (qmail 21455 invoked by uid 22791); 29 Jun 2008 19:42:37 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 29 Jun 2008 19:41:43 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m5TJfenC029749 for ; Sun, 29 Jun 2008 15:41:40 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m5TJfeSP020201; Sun, 29 Jun 2008 15:41:40 -0400 Received: from opsy.redhat.com (vpn-10-29.bos.redhat.com [10.16.10.29]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m5TJfeqs003581; Sun, 29 Jun 2008 15:41:40 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 970FA378267; Sun, 29 Jun 2008 13:41:39 -0600 (MDT) To: Eli Zaretskii Cc: Vladimir Prus , marc.khouzam@ericsson.com, gdb-patches@sources.redhat.com Subject: Re: [MI non-stop 04/11] Implement --thread and --frame. References: <200806282044.14246.vladimir@codesourcery.com> <6D19CA8D71C89C43A057926FE0D4ADAA04E1BD85@ecamlmw720.eamcs.ericsson.se> <200806291003.28226.vladimir@codesourcery.com> From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom Date: Mon, 30 Jun 2008 00:09:00 -0000 In-Reply-To: (Eli Zaretskii's message of "Sun\, 29 Jun 2008 20\:48\:02 +0300") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2008-06/txt/msg00582.txt.bz2 >>>>> "Eli" == Eli Zaretskii writes: Eli> I think the variant with threadStr[] and sizeof - 1 is more Eli> maintainable, especially since not everyone uses Emacs. Moreover, a Eli> literal constant makes code a bit harder to read, since I need to Eli> count characters after you, to be sure I understand exactly what your Eli> code does. libcpp uses: #define DSC(str) (const unsigned char *)str, sizeof str - 1 Sometimes this is a bit obscure but it has the nice quality that you can use the string constant in the place where it is needed, and you only have to write it once. (The 'unsigned' is because libcpp uses unsigned chars everywhere -- gdb wouldn't need this.) Eli> (Btw, in stock Emacs "ESC =" counts _lines_ in region, not characters. Eli> You probably have some customization that does this.) FWIW count-lines-region displays the number of characters as well as the number of lines. Tom