linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* RE: Debugging with no serial port
@ 2006-08-10 20:12 Martin, Tim
  2006-08-10 20:53 ` Ben Warren
  0 siblings, 1 reply; 8+ messages in thread
From: Martin, Tim @ 2006-08-10 20:12 UTC (permalink / raw)
  To: bwarren; +Cc: linuxppc-embedded

Ben,

>	How about something a bit simpler like running gdb within a
'script' context,
> which will log your session to a file.  Get gdb to print the variables
to the screen
> (using 'print' or whatever), wrap your data with easily searchable
characters=20
> (eg. ***data1 data2 data3***), then filter your data from the script
file with sed/awk
> or perl scripts?
=09
I tried this as well and have the same GDB synchronization problem e.g.

break log_stuff
commands
   silent
   if (variable_logging_enabled)
      printf "(%d,%d)\n",stuff1_variable,stuff2_variable
   end
   cont
end

The printf's don't complete before the cont happens.  Sounds like maybe
this is a GDB problem...

Tim
=09

^ permalink raw reply	[flat|nested] 8+ messages in thread
* RE: Debugging with no serial port
@ 2006-08-11 16:30 Martin, Tim
  0 siblings, 0 replies; 8+ messages in thread
From: Martin, Tim @ 2006-08-11 16:30 UTC (permalink / raw)
  To: bwarren; +Cc: linuxppc-embedded

=20
> > =09
> > I tried this as well and have the same GDB synchronization=20
> problem e.g.
> >=20
> > break log_stuff
> > commands
> >    silent
> >    if (variable_logging_enabled)
> >       printf "(%d,%d)\n",stuff1_variable,stuff2_variable
> >    end
> >    cont
> > end
> >=20
> That's too bad.  I wonder if you could run gdb from expect or=20
> some other auto-scripting language and have it issue the=20
> 'cont' once all data is printed (Have your code spit out a=20
> special 'end of data' delimiter).=20
>=20
> Just a thought - no idea if it would work. =20
>=20

What a brilliant idea!  I tried this and it works perfectly.  Having no
previous expect experience, I was able to generate and modify the expect
script with "autoexpect" in about 10 minutes.

Thanks!
Tim

^ permalink raw reply	[flat|nested] 8+ messages in thread
* RE: Debugging with no serial port
@ 2006-08-10 19:00 Martin, Tim
  2006-08-10 19:13 ` Brian Waite
  0 siblings, 1 reply; 8+ messages in thread
From: Martin, Tim @ 2006-08-10 19:00 UTC (permalink / raw)
  To: Frank, linuxppc-embedded

=20
>> Second question would be - is there an easier way to accomplish what=20
>> I'm trying to do, which is basically emulate a serial port with GDB.

>=20
> Use NetConsole or remotey log it with syslog...
>=20

I guess I wasn't clear in the problem statement - this target doesn't
have a serial port, an ethernet port, or a file system.  So I can't log
over Ethernet or log by writing to a file.  I'm fairly restricted to
getting data out of the system using GDB controlling a hardware JTAG
debugger (think BDI2000).

Tim

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Debugging with no serial port
@ 2006-08-10 17:14 Martin, Tim
  2006-08-10 17:31 ` Frank
  2006-08-10 19:27 ` Ben Warren
  0 siblings, 2 replies; 8+ messages in thread
From: Martin, Tim @ 2006-08-10 17:14 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 1652 bytes --]

This may be more of a question for GDB folks...but I'll post it here
because it relates to embedded systems as well.
 
I'm trying to validate some signal processing software on an embedded
Virtex4 PowerPC 405.  Basically, the validation consists of calling
functions and looking at their outputs.  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).
 
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.  But
on this particular target, I don't have a serial port.  So I thought
about using GDB's breakpoint command list feature.  When the software
has data it wants to print out, it calls a function "log_stuff".  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.  E.g. the following command file does this:
 
break log_stuff
commands
   silent
   if (variable_logging_enabled)
      append value outputfile.bin stuff1_variable
      append value outputfile.bin stuff2_variable
   end
   cont
end
 
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.  So my first question would be, is there some GDB "flush" like
command I could run before the cont statement?
 
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.
 
Tim
 

[-- Attachment #2: Type: text/html, Size: 3784 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-08-11 16:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-10 20:12 Debugging with no serial port Martin, Tim
2006-08-10 20:53 ` Ben Warren
  -- strict thread matches above, loose matches on Subject: below --
2006-08-11 16:30 Martin, Tim
2006-08-10 19:00 Martin, Tim
2006-08-10 19:13 ` Brian Waite
2006-08-10 17:14 Martin, Tim
2006-08-10 17:31 ` Frank
2006-08-10 19:27 ` Ben Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).