From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16316 invoked by alias); 3 Nov 2008 19:26:58 -0000 Received: (qmail 16276 invoked by uid 22791); 3 Nov 2008 19:26:57 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 03 Nov 2008 19:26:02 +0000 Received: from mailhost4.vmware.com (mailhost4.vmware.com [10.16.67.124]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 348A23A008; Mon, 3 Nov 2008 11:26:00 -0800 (PST) Received: from [10.20.92.59] (promb-2s-dhcp59.eng.vmware.com [10.20.92.59]) by mailhost4.vmware.com (Postfix) with ESMTP id 2BF30C9A34; Mon, 3 Nov 2008 11:26:00 -0800 (PST) Message-ID: <490F4EAB.206@vmware.com> Date: Mon, 03 Nov 2008 19:26:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: "ebo@sandien.com" CC: "gdb@sourceware.org" Subject: Re: using gdb to do embedded unit/regression testing References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-11/txt/msg00016.txt.bz2 EBo wrote: > Hello, > > I have a simple proof of concept which does simple live inplace > unit/regression testing on embedded hardware via a JTAG interface. To really > make gdb work for this context I will either have to use "More complex GDB > scripting" and/or modify gdb's command line interface and print command. You should check out src/gcc/testsuite. The gcc testsuites on embedded targets are all set up to use gdb as an execution engine. And you get to use dejagnu as your scripting language (lucky you). > 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. Yeah, we've all run into that. Use gdb "echo", rather than print. Doesn't help if you have variables, but for simple diagnostics it's ok. > The second issue will be cleaning up and formatting the output from the > automated unit/regression test suites. For this I will want/need to suppress > almost all output from gdb, and use the print command above to deal with the > formatting. If I end up using gdb to help do this type of eXtreme/Agile > program testing I would like to work with the gdb maintainers to have it > integrated upstream... I think you want dejagnu.