From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26324 invoked by alias); 19 Jan 2014 17:53:26 -0000 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 Received: (qmail 26314 invoked by uid 89); 19 Jan 2014 17:53:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-we0-f172.google.com Received: from mail-we0-f172.google.com (HELO mail-we0-f172.google.com) (74.125.82.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 19 Jan 2014 17:53:24 +0000 Received: by mail-we0-f172.google.com with SMTP id q58so6287324wes.31 for ; Sun, 19 Jan 2014 09:53:21 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.194.174.197 with SMTP id bu5mr163289wjc.71.1390154001198; Sun, 19 Jan 2014 09:53:21 -0800 (PST) Received: by 10.194.17.104 with HTTP; Sun, 19 Jan 2014 09:53:21 -0800 (PST) In-Reply-To: <83txczj2o2.fsf@gnu.org> References: <52b9da59.64ab440a.0b0b.7e1c@mx.google.com> <83ha9w68av.fsf@gnu.org> <87sit4kb1t.fsf@gnu.org> <83eh4ow78t.fsf@gnu.org> <87k3egez8e.fsf@gnu.org> <87mwitovvh.fsf@gnu.org> <83wqhvj4bw.fsf@gnu.org> <83txczj2o2.fsf@gnu.org> Date: Sun, 19 Jan 2014 17:53:00 -0000 Message-ID: Subject: Re: [PATCH v1 02/36] Guile extension language: doc additions From: Doug Evans To: Eli Zaretskii Cc: =?ISO-8859-1?Q?Ludovic_Court=E8s?= , "gdb-patches@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00721.txt.bz2 On Sun, Jan 19, 2014 at 9:34 AM, Eli Zaretskii wrote: >> Date: Sun, 19 Jan 2014 09:19:45 -0800 >> From: Doug Evans >> Cc: Ludovic Court=E8s , >> "gdb-patches@sourceware.org" >> >> For C-like languages, a value is a string if it is a pointer to or an >> array of characters or ints of type @code{wchar_t}, @code{char16_t}, >> or @code{char32_t}. The string is assumed to be terminated >> by a zero of the appropriate width. However if the optional length >> argument is given, the string will be converted to that given length, >> and will include any embedded zeros that the string may contain. > > The only problem with this text is that it seems to cover _only_ > C-like languages. It says nothing about the other languages. > > How about this: > > For C-like languages, a value is a string if it is a pointer to or an > array of characters or ints of type @code{wchar_t}, @code{char16_t}, > or @code{char32_t}. For other languages ... [say here how string > values are distinguished in other languages]. If the string is > terminated by a zero of the appropriate width, it will be converted up > to that zero. For strings that are not zero-terminated (which > includes strings in non C-like languages), you must specify the length > for conversion. Even in C-like languages the user may wish to specify a length. E.g., C++ strings have a length, but it's up to the library to specify how = it's recorded. Plus C++ programs can have multiple string implementations (not just std::string). Not always ideal, but an app may have a specific performance issue for a specific part of it and thus provides its own string implementation for that part. Thus in this (important) case there is no text I can provide here to answer the question you are asking. Plus there's a maintenance issue of describing how each language defines a string. We don't want to have to update this part for each new language. There's a functionality that GDB provides to the extension language: zero-terminated or provide your own length. That's all Guile (or Python) can provide because for now that's all GDB let's them. Please can I keep the current text? We can certainly revise it later.