|How do debuggers work? omtzigt-theo@CS.YALE.EDU (Erwinus Theodorus Leonardus Omtzigt (Theo)) (1991-11-27)|
|Re: how do debuggers work... email@example.com (1991-12-03)|
|From:||firstname.lastname@example.org (Steve Simmons)|
|Organization:||CONVEX Computer Corporation, Richardson, Tx., USA|
|Date:||Tue, 3 Dec 1991 14:11:15 GMT|
A simple answer to that complex question is...
The compiler generates a descriptive interface that is distinct from the
object code. This interface maps the realized machine code and data back
to the original source text. That is, ranges of PCs are associated with a
source statement. Offsets from either a frame on the stack or base of a
memory segment are associated with variables. From here, a debugger is
capable placing breakpoints on pc addresses and examining/translating
areas in memory.
The best reference on this is Aho, Hopcroft, and Sethi, the last dragon
book. There are many other papers. On Unix, the most common interface is
the STAB interface. This was defined by Mark Linton when he was at
Stanfod. He is now at SGI (I think).
Recently, Convex has defined a new Compiler-Debugger Interface for its
compiler so that it may better support optimized code. That is, code
motion causes a fragmentation in PC ranges and there is no longer a
one-to-one mapping. Also, uses of variables are optimized into uses of
compiler-synthesized variables. These issues must be dealt with.
Return to the
Search the comp.compilers archives again.