jacob navia wrote, On 13/03/08 09:55:
Anyone can tell stories. I am in face of super heroes that do not
use debuggers and understand (like "Flash gordon" tells) an assembler
program without even knowing the source code.
That is not what I said. The language I did not know was Coral 66 and I
stated this. The assembler was one that I had only just been on a course
to learn and I had never seen the code before I started debugging it.
The really horrible project was a different and very horrible assembler.
In over 20 years of programming on a range of systems in a range of
application domains I have done a lot of different things.
Yeah, great. Either his program was doing
2+2 = 5
and he spotted immediately the bug obviously, or he has read too
much science fiction and is playing superman.
No. For one of the most serious bugs the on the assembler program I
looked at the symptoms...
Almost as soon as you touch the controls on the external controller
the system crashes.
Thinks, those controls are being sent to the system over an interrupt
driven serial link. Must check the interrupt handler.
Read the comments for the interrupt handler and the code itself. The
comments say the rest of the code must not use ar6 and the interrupt
handler uses ar6 without saving it.
Thinks, must check if this rule is violated.
Check the rest of the code for references to ar6 and lo and behold
there they are!
Change interrupt handler so it saves and restores ar6.
Test, it no longer crashes as soon as you touch the controls.
That was just one of the things I debugged, in this instance it really
was simply by reading the comments, reading the code, thinking and
(possibly) using search tools on the code.
This was an embedded system and we did not have a debugger I could hook
up. All I could do was get the hardware engineer to hook up a logic
analyser (which meant putting the card on an extender which changed
timings introducing other problems with the video processing. However,
the logic analyser was a lot less helpful than you might expect due to
the nature of the processor.
Other bugs on the system turned out to be either design or algorithm
bugs, and they were solved by reverse engineering from the code what the
algorithm was and then studying the algorithm and thinking about how it
would behave under certain conditions.