From: vb <vb@vsbe.com>
To: "Nick Roberts" <nickrob@snap.net.nz>
Cc: gdb@sourceware.org
Subject: Re: access variables in canned command sequences
Date: Tue, 10 Apr 2007 19:05:00 -0000 [thread overview]
Message-ID: <f608b67d0704101204i1045689wb8c14e6eedf7d05@mail.gmail.com> (raw)
In-Reply-To: <17946.47368.392951.298692@farnswood.snap.net.nz>
On 4/9/07, Nick Roberts <nickrob@snap.net.nz> wrote:
> > > define xyz
> > > printf "offset is %d\n", $offs
> > > end
> > >
> >
> > Yeah, this works as we know, but is there any way of passing an
> > internal variable value to the shell?
>
> It's not clear to me what you want to do but you could write the data to a
> file and read that file from the shell script:
>
> set logging file input.dat
>
> define xyz
> set logging on
> printf "offset is %d\n", $offs
> set logging off
> end
>
> However, perhaps we know that too.
No, this I did not know, and it probably will do what I need, let me look.
Thanks a lot for the hint, Nick!
cheers
vadim
> AFAIK convenience variables are handled in
> GDB just like ordinary program variables. I don't think you can currently
> regard the GDB command line as a program language but Daniel Jacobowitz is
> working on something more powerful.
>
> > Somebody mentioned setting up an environment variable - this seems
> > interesting, I tried
> >
> > set environment offset 0x1000
> > shell env | grep offset
> >
> > `offset' does not get set for the shell started from within gdb....
>
> (gdb) help set environment
> Set environment variable value to give the program.
> ^^^^
> --
> Nick http://www.inet.net.nz/~nickrob
>
prev parent reply other threads:[~2007-04-10 19:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-06 18:26 vb
2007-04-06 18:52 ` Michael Snyder
2007-04-08 14:06 ` Daniel Jacobowitz
2007-04-09 10:19 ` Nick Roberts
2007-04-09 19:39 ` vb
2007-04-09 22:09 ` Nick Roberts
2007-04-10 19:05 ` vb [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f608b67d0704101204i1045689wb8c14e6eedf7d05@mail.gmail.com \
--to=vb@vsbe.com \
--cc=gdb@sourceware.org \
--cc=nickrob@snap.net.nz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox