Re: Debugging: Am I a dreamer. . . ?



In article <X0BDLJNJEFGIFAL8@xxxxxxxxxxxxxxxxxxxx>, Chris H <chris@xxxxxxxxxxxx> writes:
In message <48184695$0$23852$8404b019@xxxxxxxxxxxxxxx>, David Brown
<david@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> writes

What's wrong with debugging using printf? I don't mean specifically
"printf", which you should normally avoid in a small embedded system,

Well you have answered the question.

but the general idea of putting out extra information while the program
runs is a very useful debugging technique.

Yes but not the same as using printf.


Are you objecting to the use of the C function printf() within a embedded
environment for debugging or are you objecting to the use of serial port
output as a debugging tool ?

In AVR land, I don't use printf as it's bloated (by embedded standards),
but I do have my own interrupt based UART I/O routines that I use for
normal communication with other serial devices as well as debugging.

The routines implement a tty for the hardware UART as well as a Tx-only
software UART for debugging output. As both UART's are interrupt based,
and the output can be optionally buffered in an application specified
buffer, I see very little overhead in using the software UART for
outputting debug information.

Simon.

--
Simon Clubley, clubley@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Microsoft: Bringing you 1980's technology to a 21st century world
.



Relevant Pages

  • Re: Debugging: Am I a dreamer. . . ?
    ... systems programming. ... You know the PIC16F684 chip that costs less than a dollar, ... Many chips have in-circuit debugging features, ... debugging that you can twiddle with in software instead of a printf is ...
    (comp.arch.embedded)
  • Re: Printing from kernel
    ... >area where it's unsafe to print, probably holding a lock that's needed ... Instead of messages from kernel I see the first letter ... >No. printf() is widely used in the kernel. ... It is used not only for debugging by myself, part of this output is my ...
    (freebsd-hackers)
  • Re: Debugging: Am I a dreamer. . . ?
    ... What's wrong with debugging using printf? ... runs is a very useful debugging technique. ... One thing that often seems to get overlooked is assert(). ... neat trick is the trigger behaviour. ...
    (comp.arch.embedded)
  • Re: Debugging: Am I a dreamer. . . ?
    ... systems programming. ... or debugger to remove bugs, only gives the design more bugs. ... You should never debug using printf. ... runs is a very useful debugging technique. ...
    (comp.arch.embedded)
  • Re: Debugging: Am I a dreamer. . . ?
    ... When I did C programming for a personal computer, ... or debugger to remove bugs, only gives the design more bugs. ... You should never debug using printf. ... I don't mean specifically "printf", which you should normally avoid in a small embedded system, but the general idea of putting out extra information while the program runs is a very useful debugging technique. ...
    (comp.arch.embedded)