RE: Debugging with no serial port

2 messages, 2 authors, 2006-08-10 · open the first message on its own page

RE: Debugging with no serial port

From: Martin, Tim <hidden>
Date: 2006-08-10 20:12:50

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

RE: Debugging with no serial port

From: Ben Warren <hidden>
Date: 2006-08-10 20:53:56

Martin,

On Thu, 2006-08-10 at 13:12 -0700, Martin, Tim wrote:
	
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
That's too bad.  I wonder if you could run gdb from expect or some other
auto-scripting language and have it issue the 'cont' once all data is
printed (Have your code spit out a special 'end of data' delimiter). 

Just a thought - no idea if it would work.  

I'm not 100% certain how BDI-2000/gdb works, but I guess the gdb server
is running on the box, in which case you probably don't have much
control over how it works, and thus can't control if the output stream
is buffered or not.  My BDI-2000 book doesn't have much on configuring
the gdb part.

Anyway, sorry for rambling.

regards,
Ben
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help