This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.
> 
> set $test="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.
> 
> 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 = "a"
(gdb) p $a
$1 = 0x8244708 "a"

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]