Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compilers > Re: need ideas ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 5 Topic 2341 of 2472
Post > Topic >>

Re: need ideas on how to debug code generator

by Nils <n.pipenbrinck@[EMAIL PROTECTED] > Feb 26, 2008 at 02:55 AM

Ram Bhamidipaty schrieb:
>
> What are some techniques that people have used for debugging code
> generators?

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
fault.

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...

Nils
 




 5 Posts in Topic:
need ideas on how to debug code generator
Ram Bhamidipaty <rambh  2008-02-24 21:47:50 
Re: need ideas on how to debug code generator
Thomas Have <thomas@[E  2008-02-25 17:59:42 
Re: need ideas on how to debug code generator
Nils <n.pipenbrinck@[E  2008-02-26 02:55:34 
Re: need ideas on how to debug code generator
"Bartc" <bc@  2008-02-27 18:07:17 
Re: need ideas on how to debug code generator
Joel Yliluoma <bisqwit  2008-02-28 06:34:50 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 2:58:35 CDT 2008.