This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: using gdb to do embedded unit/regression testing
- From: Daniel Jacobowitz <drow at false dot org>
- To: EBo <ebo at sandien dot com>
- Cc: gdb at sourceware dot org
- Date: Mon, 3 Nov 2008 14:20:37 -0500
- Subject: Re: using gdb to do embedded unit/regression testing
- References: <twig.1225739451.50844@swcp.com>
On Mon, Nov 03, 2008 at 12:10:51PM -0700, EBo wrote:
> The current issue at hand is that `print "STRING"` only works if the program
> is running AND gdb can interface with malloc. On the embedded project which I
> am currently testing this idea out, malloc is not available and the print
> command returns an error. What I was trying to do is simply write some
> diagnostic comments to help orient myself when reading the output from gdb
> which was piped to a file. If there is some other way to write diagnostic
> strings to stdout other than `print "STRING"` which does not require some call
> to malloc? If so please let me know. I have not seen anything like this in
> the documentation yet.
Try the "echo" and "printf" commands instead. These give you much
more control over output.
Also, "print" may not call malloc if you use a current snapshot of the
GDB development sources.
--
Daniel Jacobowitz
CodeSourcery