This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: access variables in canned command sequences
- From: Michael Snyder <Michael dot Snyder at access-company dot com>
- To: vb <vb at vsbe dot com>
- Cc: gdb at sourceware dot org
- Date: Fri, 06 Apr 2007 11:51:59 -0700
- Subject: Re: access variables in canned command sequences
- References: <f608b67d0704061126x80f130ay338aff70cd389b16@mail.gmail.com>
On Fri, 2007-04-06 at 11:26 -0700, vb wrote:
> Hello all,
>
> I need to be able pass a convenience variable defined in gdb command
> file to a shell script from inside a canned sequence, something like
> this:
>
> set $offs=0x1ff80000
> define xyz
> shell echo offset is $offs
> end
>
> what happens when I run it - the parameter does not get passed to the
> shell at all:
>
> (gdb) xyz
> offset is
> (gdb)
>
>
> What gives?!
I imagine that the command "echo offset is $offs" is passed directly
to the shell. The shell doesn't have a variable $offs, so nothing
gets printed.
I'm not sure how to work around this.