|need ideas on how to debug code generator firstname.lastname@example.org (Ram Bhamidipaty) (2008-02-24)|
|Re: need ideas on how to debug code generator email@example.com (Thomas Have) (2008-02-25)|
|Re: need ideas on how to debug code generator firstname.lastname@example.org (Nils) (2008-02-26)|
|Re: need ideas on how to debug code generator email@example.com (Bartc) (2008-02-27)|
|Re: need ideas on how to debug code generator firstname.lastname@example.org (Joel Yliluoma) (2008-02-28)|
|Date:||Tue, 26 Feb 2008 02:55:34 +0100|
|Posted-Date:||25 Feb 2008 23:00:40 EST|
Ram Bhamidipaty schrieb:
> What are some techniques that people have used for debugging code
I did a codegenerator for the MIPS4 architecture a year ago. What I
did for debugging was to write a simple emulator for the instruction
set. For MIPS this was easy to do because the instructions are
trivial to decode and simulate. With a bit of work the same can be
done for x86 as well.
My debugging jobs have always been easy because my generated code was
"only" executing rendering loops for graphics. The readable and
writeable memory regions were well defined, so catching page-faults
has been easy.
If you write such a simple emulator, set aside some memory and record
the CPU state for each instruction. This makes it easy to trace back
in time and _exactly_ find out the conditions that caused the page
Best debugging tool I ever had. The Watcom Debugger that I used 10
years ago had a similar feature. I wonder why we don't have such
useful things built in our tools anymore...
Return to the
Search the comp.compilers archives again.