Hello,
On Sat, 18 Jan 2020, Herman ten Brugge via Tinycc-devel wrote:
Oops. Sent the wrong patch. See correct one in attachment.
I created a path to add debug type information (see attachment).
The patch only supports basic types and array/ptr types of them.
It also doesn't deal with scopes, i.e. represents this incorrectly:
int foo (void) {
int i = 1;
float f;
if (i) {
float i = 1.0;
f = i;
}
return i + f;
}
It's still useful, of course, also with the limitation. Some time ago
I approached the debug problem from that angle first before dealing
with types, see attached patch (which makes all variable be int). But
I didn't like the outcome in that it uses a new data structure for the
scopes and the associated book keeping. The difficulty with stabs is
that the variables for a scope need to be emitted directly _before_
the scope-open stab, which really goes against the structure of TCCs
parser, as the open/close stabs still need to form a correct nesting,
so there's no natural place to emit the variable stabs :-/