dump memory to file

Daniel Jacobowitz drow@mvista.com
Wed Aug 22 11:00:00 GMT 2001


On Wed, Aug 22, 2001 at 10:52:24AM -0700, Kevin Buettner wrote:
> On Aug 22, 11:00am, Grant Edwards wrote:
> 
> > A while back I had asked if gdb could dump a section of target
> > memory to disk (as bin, elf, hex, whatever).  The answer at the
> > time was no -- is that still the case?  If I added such a
> > command, would it be of interest to anybody else? (IOW, should
> > I submit a patch?)
> 
> I think it'd be nice to provide a more general solution.  I.e, I think
> it'd be nice if GDB had a facility whereby output from subsequent
> commands would be redirected to a file.  Maybe something along the
> following lines?
> 
> (gdb) redirect-output /tmp/foo
> (gdb) x/10000x 0x01000
> (gdb) print/x $pc
> (gdb) x/100i $pc-200
> (gdb) redirect-output STDOUT
> 
> And, it'd also be nice to redirect to be able to redirect to two or
> more destinations at the same time...
> 
> (gdb) redirect-output /tmp/foo STDOUT
> ...

This is on our internal wishlist bugs list :)

I was going to do it more like 'set logfile', although I hadn't
considered when you don't want it to show up on the screen.  Perhaps
'set log file <filename>' and 'set log only 1'?

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer



More information about the Gdb mailing list