J
jacob navia
Yossi said:Hi!
There's this way of doing real time debug prints which look like
printf calls:
log3("points[%d]={%d,%d}\n", i, points.x, points.y);
The implementation writes something like {format-string-ptr, num-args,
arg0, arg1, arg2} to a binary log buffer. The buffer is written out in
binary form, and then the formatting is done at the host. The string
pointers are "decoded" by reading the constant format strings out of
the program image or, more portably, they can be collected by the
target code when the binary log buffer is written out, at the cost of
a slight time & space overhead.
Is there a free implementation of something like this? Do you think it
would be useful?
-- Yossi
Of course it is possible. I did it when implementing a debugger for an
embedded DSP. The printf specs were kept in the host,
and the in place debugger sent the raw data through a serial line.
Now, "real time" will be another thing, since this takes time, the
serial line keeps the processor busy, and there is obviously a
big debugger overhead. But there is no free lunch!