Re: Simple Debugger Design

"Joachim Durchholz" <>
20 Jun 2000 02:42:28 -0400

          From comp.compilers

Related articles
Simple Debugger Design (Nicolás) (2000-06-10)
Re: Simple Debugger Design (Joachim Durchholz) (2000-06-14)
Re: Simple Debugger Design (Joachim Durchholz) (2000-06-20)
| List of all articles for this month |

From: "Joachim Durchholz" <>
Newsgroups: comp.compilers
Date: 20 Jun 2000 02:42:28 -0400
Organization: Compilers Central
References: 00-06-041 00-06-052
Keywords: debug, design

John wrote:
> [The hard parts are tracking what object code corresponds to
> what source code, particularly after optimization that
> rearrangs the code,

Hmm... I don't think this is done in assemblers. But it's still an
issues: assembly code usually makes heavy use of macros, and it will
indeed be a challenge to preserve enough information to reconstruct
the original source.

> and keeping enough info to prettyprint data structures. -John]

That's a real issue for assemblers, yes (there are typically many ways
to represent binary data in an assembly language, e.g. strings may be
represented as byte values or character sequences).

Actually the easiest and most reliable way is to just store the full
source in the binary (maybe after stripping irrelevant parts). With
today's disk drive capacities, this isn't usually a problem.
I'm using a compiler that does this on a routine basis for debug builds.
It wants to present the exact source code as of compilation time during
debugging (and this *is* a form of reverse compilation), and it works
like a charm. (Well, debug executables are roughly five time the size of
production builds, but this is both due to the inclusion of source code
and to the generation of extensive checking code.)


Post a followup to this message

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