From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6442 invoked by alias); 24 Feb 2007 20:11:12 -0000 Received: (qmail 6431 invoked by uid 22791); 24 Feb 2007 20:11:12 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 24 Feb 2007 20:11:06 +0000 Received: from kahikatea.snap.net.nz (226.61.255.123.dynamic.snap.net.nz [123.255.61.226]) by viper.snap.net.nz (Postfix) with ESMTP id 3BE4C3D9D1F; Sun, 25 Feb 2007 09:11:03 +1300 (NZDT) Received: by kahikatea.snap.net.nz (Postfix, from userid 500) id BD8A74F707; Sun, 25 Feb 2007 09:11:03 +1300 (NZDT) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17888.39894.136355.447008@kahikatea.snap.net.nz> Date: Sat, 24 Feb 2007 20:53:00 -0000 To: Daniel Jacobowitz Cc: gdb@sourceware.org Subject: Re: [RFC] Signed/unsigned character arrays are not strings In-Reply-To: <20070224161315.GA27534@caradoc.them.org> References: <17887.62990.937672.281975@kahikatea.snap.net.nz> <20070224161315.GA27534@caradoc.them.org> X-Mailer: VM 7.19 under Emacs 22.0.94.2 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: 2007-02/txt/msg00258.txt.bz2 > Does adding an appropriate (char *) cast fix the problem, and do you > think it's reasonable? If you mean in .gdbinit, changing define xprintstr set $data = $arg0->data output ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~gdb_array_mark_flag : $arg0->size_byte) end to: define xprintstr set $data = $arg0->data output (char *) ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~gdb_array_mark_flag : $arg0->size_byte) end makes no difference. I don't understand why unsigned chars should be printed as arrays except to solve Jan's particular problem. Maybe Emacs uses unsigned char for 8 bit character sets like iso_8859-1: 2000-01-04 Gerd Moellmann * lisp.h (struct Lisp_String): Make DATA member `unsigned char *'. Like another change that Ulrich Drepper is proposing (%a) this patch changes existing behaviour. Why not just add a new output format, or boolean variable? -- Nick http://www.inet.net.nz/~nickrob