How to print to a file or pipe ??

Grant Edwards grante@visi.com
Thu Jul 27 09:50:00 GMT 2000


On Thu, Jul 27, 2000 at 09:37:43AM -0400, Jesse Marlin wrote:
> James Gunning writes:

>  > 	I'm new to this list, but I have searched unsuccessfully through
>  > the gdb info pages  & archives for an answer to this question.
>  > 	How do I print gdb output to a file. Something like
>  > 	print a[1]@1000 > file.txt
>  > would be ace :-)

This question has been asked several times since I've been
reading the list.  Somebody once posted a patch to dump memory
to file, but I don't think it made it into the official
version.  I regularly need to do exactly what you describe, and
have resorted to cut/paste from an xterm.  Not elegant, but it
works.

> If you run gdb from within xemacs or even emacs then printing
> is no problem. Just highlight the region you are interested in
> and, M-x print-region.

I'd really prefer to be able to do it with commands so that it
can be automated or done from within a macro.  

Obviously I haven't wanted it badly enough to actually
impliment something like that and submit a patch.  ;) 

But it would be handy.

-- 
Grant Edwards
grante@visi.com


More information about the Gdb mailing list