From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15441 invoked by alias); 30 Jun 2008 18:23:43 -0000 Received: (qmail 15430 invoked by uid 22791); 30 Jun 2008 18:23:42 -0000 X-Spam-Check-By: sourceware.org Received: from bluesmobile.specifix.com (HELO bluesmobile.specifix.com) (216.129.118.140) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 30 Jun 2008 18:22:53 +0000 Received: from [127.0.0.1] (bluesmobile.specifix.com [216.129.118.140]) by bluesmobile.specifix.com (Postfix) with ESMTP id 74C443C14C; Mon, 30 Jun 2008 11:22:51 -0700 (PDT) Subject: Re: [MI non-stop 04/11] Implement --thread and --frame. From: Michael Snyder To: tromey@redhat.com Cc: Eli Zaretskii , Vladimir Prus , marc.khouzam@ericsson.com, gdb-patches@sources.redhat.com In-Reply-To: References: <200806282044.14246.vladimir@codesourcery.com> <6D19CA8D71C89C43A057926FE0D4ADAA04E1BD85@ecamlmw720.eamcs.ericsson.se> <200806291003.28226.vladimir@codesourcery.com> Content-Type: text/plain Date: Mon, 30 Jun 2008 18:35:00 -0000 Message-Id: <1214850171.3601.1516.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-7.fc7) Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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/msg00594.txt.bz2 On Sun, 2008-06-29 at 13:41 -0600, Tom Tromey wrote: > >>>>> "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.) Boy... IMHO, I find that *very* obscure. I wouldn't like reading code that used that, if I had no idea what it was or where it was defined. Granted it's also clever...