This is the mail archive of the gdb@sourceware.org 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: capturing command output to a variable


>>>>> "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


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