From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7596 invoked by alias); 27 Feb 2003 14:35:46 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 7548 invoked from network); 27 Feb 2003 14:35:44 -0000 Received: from unknown (HELO ns2.uk.superh.com) (193.128.105.170) by 172.16.49.205 with SMTP; 27 Feb 2003 14:35:44 -0000 Received: from sh-uk-ex01.uk.w2k.superh.com (sh-uk-ex01 [192.168.16.17]) by ns2.uk.superh.com (8.11.6+Sun/8.11.6) with ESMTP id h1REHZn03048; Thu, 27 Feb 2003 14:17:35 GMT content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: String handling in GDB command language variables X-MimeOLE: Produced By Microsoft Exchange V6.0.5762.3 Date: Thu, 27 Feb 2003 14:35:00 -0000 Message-ID: <9FF3133289A7A84E81E2ED8F5E56B379537DB7@sh-uk-ex01.uk.w2k.superh.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Fyles, Matthew" To: "Daniel Jacobowitz" Cc: X-SW-Source: 2003-02/txt/msg00580.txt.bz2 When not connected to any target is it possible to store a string value in a convenience variable. i.e sh-superh-elf-gdb -nw GNU gdb 5.2.1 Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=3Di686-pc-linux-gnu --target=3Dsh-superh-elf". (gdb) set $test=3D1 (gdb) print $test $1 =3D 1 (gdb) set $test=3D"hello" evaluation of this expression requires the target program to be active (gdb) can a convenience variable be made to be a string type within the command language? -----Original Message----- From: Daniel Jacobowitz [mailto:drow@mvista.com]=20 Sent: Thursday, February 27, 2003 2:23 PM To: Fyles, Matthew Cc: gdb@sources.redhat.com Subject: Re: String handling in GDB command language variables On Thu, Feb 27, 2003 at 09:13:55AM -0000, Fyles, Matthew wrote: > Just a quick question about the string handling capability of the GDB > command language. >=20 > set $test=3D"mystring" does not work but defining a procedure and passing > a string in as an argument does, is there any further documentation > anywhere about the capabilities of the language other than the > information available in the user documentation. >=20 > Is this a feature that has been considered in the past and not > implemented or am I just not understanding the syntax for achieving > this. When you say "mystring" in the GDB command language, what you really get is malloc(9) called in the target program and "mystring" copied into it. However, you didn't say what version of GDB you were using. I just tried it in 5.3: (gdb) set $a =3D "a" (gdb) p $a $1 =3D 0x8244708 "a" --=20 Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer