* capturing command output to a variable
@ 2009-01-11 21:23 Mathew Yeates
2009-01-11 22:38 ` Tom Tromey
0 siblings, 1 reply; 2+ messages in thread
From: Mathew Yeates @ 2009-01-11 21:23 UTC (permalink / raw)
To: gdb
I understand that turning on logging will allow me to save command
output to a file. But what if I want to save the output in a
convenience variable??
e.g. How can I do something like the following where I capture the out
of the "where" command.
set $x = `where 1`
echo $x
Mathew
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: capturing command output to a variable
2009-01-11 21:23 capturing command output to a variable Mathew Yeates
@ 2009-01-11 22:38 ` Tom Tromey
0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2009-01-11 22:38 UTC (permalink / raw)
To: Mathew Yeates; +Cc: gdb
>>>>> "Mathew" == Mathew Yeates <mat.yeates@gmail.com> writes:
Mathew> I understand that turning on logging will allow me to save command
Mathew> output to a file. But what if I want to save the output in a
Mathew> convenience variable??
As far as I know, with cvs gdb this can only be done with difficulty.
For example, you could log the output of the command to a file, then
use 'shell' to run sed on the file to turn it into a gdb command which
sets the convenience variable, and then finally 'source' the result.
The Python integration will make this sort of thing much simpler,
though it occurs to me that we haven't done full I/O integration yet,
so this example remains difficult there. (I do have most of a patch
to add ui-file wrappers to Python... I guess I ought to finish that.)
Tom
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-01-11 22:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-11 21:23 capturing command output to a variable Mathew Yeates
2009-01-11 22:38 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox