The task of mapping between source programs and machine code, once the
code has been optimized and transformed by a compiler is often diffic
ult. Yet there are many instances! such as debugging optimized code or
attributing performance analysis data to source lines, when it is use
ful or necessary to understand at the source level what is occurring i
n the binary. The standard approach has been for tools to attempt to m
ap directly from the optimized binary to the original source. Such map
pings are often fragile, and sometimes inaccurate or misleading. We su
ggest an alternative approach. Rather than mapping directly between th
e original source and the binary, we create a modified version of the
source program, still recognizable, but updated to reflect some of the
effects of optimizations, thus facilitating mapping from the binary.
We have implemented a tool, Optview, to demonstrate and test these ide
as.