This is the mail archive of the
mailing list for the GDB project.
Re: String handling in GDB command language variables
On Thu, Feb 27, 2003 at 02:35:38PM -0000, Fyles, Matthew wrote:
> When not connected to any target is it possible to store a string value
> in a convenience variable.
> 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
> welcome to change it and/or distribute copies of it under certain
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for
> This GDB was configured as "--host=i686-pc-linux-gnu
> (gdb) set $test=1
> (gdb) print $test
> $1 = 1
> (gdb) set $test="hello"
> evaluation of this expression requires the target program to be active
> can a convenience variable be made to be a string type within the
> command language?
The command language always mimics the current source language being
debugged, defaulting to C; C doesn't have a string type. That's the
historical justification anyway.
If there's a consensus that a string type would be useful, it could
probably be done. I think it might be a good idea; we could use
strings for arguments to gdb commands, etc. However I'm not sure of
Anyone else out there have an opinion?
MontaVista Software Debian GNU/Linux Developer