<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=947103416-10082006><FONT face=Arial 
color=#0000ff size=2>This may be more of a question for GDB folks...but I'll 
post it here because it relates to embedded systems as well.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=947103416-10082006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=947103416-10082006><FONT face=Arial 
color=#0000ff size=2>I'm trying to validate some signal processing software on 
an embedded Virtex4 PowerPC 405.&nbsp; Basically, the validation consists of 
calling functions and looking at their outputs.&nbsp; Over time, there are 
several thousand numbers to look at, so manually looking at each number at a 
break point would be very time consuming (to put it mildly).</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=947103416-10082006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=947103416-10082006><FONT face=Arial 
color=#0000ff size=2>The normal way I would go about doing this is to print out 
the data (e.g. to a serial port) and post-process the data somewhere else.&nbsp; 
But on this particular target, I don't have a serial port.&nbsp; So I thought 
about using GDB's breakpoint command list feature.&nbsp; When the software has 
data it wants to print out, it calls a function "log_stuff".&nbsp; I then set a 
breakpoint and command list in the "log_stuff" function, which writes out the 
variables I'm interested in checking out to a file named outputfile.bin.&nbsp; 
E.g. the&nbsp;following command file does this:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=947103416-10082006><FONT 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=947103416-10082006><FONT size=2>break 
log_stuff<BR>commands<BR>&nbsp;&nbsp; silent<BR>&nbsp;&nbsp; if 
(variable_logging_enabled)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; append value 
outputfile.bin stuff1_variable</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=947103416-10082006><FONT 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; append value outputfile.bin 
stuff2_variable<BR>&nbsp;&nbsp; end<BR>&nbsp;&nbsp; 
cont<BR>end</DIV></FONT></SPAN>
<DIV dir=ltr align=left><SPAN class=947103416-10082006></SPAN><SPAN 
class=947103416-10082006><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=947103416-10082006><FONT face=Arial 
color=#0000ff size=2>The problem I have with this approach is that GDB doesn't 
finish writing out everything before it continues executing the program, so a 
backlog develops.&nbsp; So my first question would be, is there some GDB "flush" 
like command I could run before the cont statement?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=947103416-10082006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=947103416-10082006><FONT face=Arial 
color=#0000ff size=2>Second question would be - is there an easier way to 
accomplish what I'm trying to do, which is basically emulate a serial port with 
GDB.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=947103416-10082006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=947103416-10082006><FONT face=Arial 
color=#0000ff size=2>Tim</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=947103416-10082006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV></BODY></HTML>