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



On 2008-04-30, David Brown <david@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

I wasn't going to mention that as it usually causes a bun fight bit
since you have...

A bun fight sounds fun!

You should never debug using printf.

This is why there are simulators, debuggers and Emulators. Even for
PC's I can recall Borland had a system where you could debug one PC from
another. For embedded using printf should have dies out over a decade ago.

What's wrong with debugging using printf?

Nothing. It works fine for me. I'm also a fan of the
"toggling port pins" method of debugging.

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. Simulators, debuggers, and
emulators are all important for development and debugging, but
sometimes it is easier to send out signals to show what is
happening. Of course such things involve changes to your
code, and changes to the run-time characteristics of your
system - but that's often perfectly acceptable during
development and debugging. It is not a good idea to rely on
printf-style debugging as your *only* method of debugging -
but equally it is a waste to arbitrarily exclude it from your
toolbox.

I agree 100%. Many of the embedded systems I've worked on have
diagnostic headers which are connected to serial ports. Having
status information being "printed" on those ports when
significant events happen can be extremely useful. You do have
to pay attention to the timing implications...

--
Grant Edwards grante Yow! ... My pants just went
at on a wild rampage through a
visi.com Long Island Bowling Alley!!
.



Relevant Pages

  • Re: Emulators Philosophy
    ... debugging, but since actual "proving" cannot ever be done by testing, they are obviously useless for proving. ... There are some types of problems that are much more easily debugged with emulators. ... I put debugging outputs on test points to see the realtime sequence of operations. ... With an emulator which has a trace buffer it would have been less, since I could trigger on the symptom and look at the preceding execution. ...
    (comp.arch.embedded)
  • Re: Windows Mobile 5 Emulator Debugging Slow as Heck
    ... >emulators were actually faster than the new ones - my experience was the ... debugging with the old emulators is much faster than debugging with ... Robert E. Zaret, eMVP ...
    (microsoft.public.pocketpc.developer)
  • Re: Windows Mobile 5 Emulator Debugging Slow as Heck
    ... > debugging with the old emulators is much faster than debugging with ... It might also depend on which old emulators you're comparing ... ..NET Compact Framework MVP ... Prev by Date: ...
    (microsoft.public.pocketpc.developer)
  • DEBUGGING trouble
    ... debugging everything goes OK for emulators and for Windows Mobile 2003 ... but for Pocket PC 2002 I get "Unable to start..." ...
    (microsoft.public.pocketpc.developer)
  • Re: IsThere a chip with multiple (4 or 8?) serial ports??
    ... On Hardware: ... The usb-to-4 and 8 ports I saw were all over $200.. ... instantiating a whole DSP design into multiple FPGAs, ... learning curve for the whole deal would be a lot more than debugging a ...
    (sci.electronics.design)