[Dwarf-discuss] RE: Issue 050222.1
Bishop, John E
Tue May 17 08:54:03 PDT 2005
Jim Blandy> It seems to me a zero-length entry should
Jim Blandy> be ignored by the debugger.
A zero-length entry could be ignored, but it could
also be used by the compiler to pass some information
to the debugger: such as "There was a use of variable
X here which was optimized away".
One of my longer-term goals with IDB's support for
debugging optimized code is to come up with some
mechanism which would allow users to discover what
values optimized-away variables would have had if
they hadn't been optimized away.
I've considered a number of approaches to this, such
as out-of-line "thunks" the compiler would generate
which could be called by the debugger or extra in-line
code or debug-info-language expressions. But no matter
what method is used, the compiler would need to tell
the debugger where to apply the method.
So a zero-length entry with an expression could mean
"Variable X is _not_ live here, but if you evaluate
the expression, you'd get the right value".
Or, on the other hand, it could be used as part of a
value-history feature ("Grab the value of X here with
this expression; don't show it to the user because
X isn't legally live here in source language terms",
or possibly just "Note that there was a use of X here,
but we can't tell whether it was a read or a write").
Now, I'm not saying any of this is going to happen,
nor that a zero-length entry is the right way to do
it: what I'm saying is that I see the specification
outlawing something harmless which might someday be
useful, and I'd like the specification to permit it.
More information about the Dwarf-Discuss