Re: Debugging: Am I a dreamer. . . ?
- From: Grant Edwards <grante@xxxxxxxx>
- Date: Wed, 30 Apr 2008 08:35:33 -0500
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!!
.
- References:
- Debugging: Am I a dreamer. . . ?
- From: Tomás Ó hÉilidhe
- Re: Debugging: Am I a dreamer. . . ?
- From: Hao Wang
- Re: Debugging: Am I a dreamer. . . ?
- From: Chris H
- Re: Debugging: Am I a dreamer. . . ?
- From: David Brown
- Debugging: Am I a dreamer. . . ?
- Prev by Date: Re: Floating point numbers and endian ness??
- Next by Date: Re: Debugging: Am I a dreamer. . . ?
- Previous by thread: Re: Debugging: Am I a dreamer. . . ?
- Next by thread: Re: Debugging: Am I a dreamer. . . ?
- Index(es):
Relevant Pages
|