Re: Is Assembler Language essential in compiler construction?

Walter Banks <walter@bytecraft.com>
Sat, 14 Feb 2009 09:15:13 -0500

          From comp.compilers

Related articles
[9 earlier articles]
Re: Is Assembler Language essential in compiler construction? anton@mips.complang.tuwien.ac.at (2009-02-11)
Re: Is Assembler Language essential in compiler construction? cfc@shell01.TheWorld.com (Chris F Clark) (2009-02-11)
Re: Is Assembler Language essential in compiler construction? lkrupp@pssw.com (Louis Krupp) (2009-02-11)
Re: Is Assembler Language essential in compiler construction? cr88192@hotmail.com (cr88192) (2009-02-12)
Re: Is Assembler Language essential in compiler construction? marcov@stack.nl (Marco van de Voort) (2009-02-13)
Re: Is Assembler Language essential in compiler construction? tony@my.net (Tony) (2009-02-14)
Re: Is Assembler Language essential in compiler construction? walter@bytecraft.com (Walter Banks) (2009-02-14)
Re: Is Assembler Language essential in compiler construction? anton@mips.complang.tuwien.ac.at (2009-02-14)
Re: Is Assembler Language essential in compiler construction? ArarghMail902@Arargh.com (2009-02-14)
Re: Is Assembler Language essential in compiler construction? cr88192@hotmail.com (cr88192) (2009-02-16)
Re: Is Assembler Language essential in compiler construction? DrDiettrich1@aol.com (Hans-Peter Diettrich) (2009-02-16)
Re: Is Assembler Language essential in compiler construction? cr88192@hotmail.com (cr88192) (2009-02-18)
Re: Is Assembler Language essential in compiler construction? DrDiettrich1@aol.com (Hans-Peter Diettrich) (2009-02-19)
[3 later articles]
| List of all articles for this month |

From: Walter Banks <walter@bytecraft.com>
Newsgroups: comp.compilers
Date: Sat, 14 Feb 2009 09:15:13 -0500
Organization: Aioe.org NNTP Server
References: 09-02-021 09-02-025 09-02-031 09-02-038 09-02-048
Keywords: C, debug
Posted-Date: 14 Feb 2009 16:48:32 EST

Marco van de Voort wrote:


> > Yes, C is a little too high-level for that job, but it's still the
> > best portable assembly language we have. One can work around most of
> > these issues as you point out, though.
>
> (to all the people that might have tried C as backend):
>
> How do you insert debug metadata on the HLL level into your binary in such
> setup ? It seems to me your debuginfo will contain C linenumbers, typedata
> etc. IOW, how do you debug in your HLL this way?


I have used C as a back end in several compiler projects.


In general we use #line directives to refer back to the original
source file and line number. This isn't perfect but works quite
well for most code at tying debug references back to the original
source.


We did implemented a simple approach for removing the intermediate
C source from listing files that embed source and generated code.
At the end of each generated C line we add a // followed by current
original source if any. We then strip the source part of the listing file
until after // and retain the remainder. We added a pragma to our
C compilers which will strip the C intermediate. For other compilers
a simple filter program can process the listing file to accomplish the
same thing.


Regards,


--
Walter Banks
Byte Craft Limited
http://www.bytecraft.com



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.