[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Add debug information.

From: Christian Jullien
Subject: Re: [Tinycc-devel] Add debug information.
Date: Mon, 20 Jan 2020 06:08:17 +0100

Hi Michael,

On Windows I get this error for 113_btdll new test:

Test: 113_btdll...
a1:1: error: unrecognized character \x00
--- 113_btdll.expect    2020-01-19 14:19:07.618126600 +0100
+++ 113_btdll.output    1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +0,0 @@
-113_btdll.c:12: at f_1: hello from f_1() / 113_btdll.c:12
-113_btdll.c:37: by main
-113_btdll.c:20: at f_2: hello from f_2() / 113_btdll.c:20
-113_btdll.c:38: by main
-113_btdll.c:31: at f_main: hello from f_main() / 113_btdll.c:31
-113_btdll.c:39: by main
make[2]: *** [Makefile:93: 113_btdll.test] Error 1
make[2]: Target 'all' not remade because of errors.
make[1]: *** [Makefile:99: tests2-dir] Error 2

-----Original Message-----
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=address@hidden]
On Behalf Of Michael Matz
Sent: Monday, January 20, 2020 01:38
To: Herman ten Brugge via Tinycc-devel
Cc: Herman ten Brugge
Subject: *** SPAM *** Re: [Tinycc-devel] Add debug information.


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 :-/


>>  So:
>>  int main(int argc, char *argv[])
>>  is supported.
>>  Other things like structs/unions/enums/bitfields are all translated 
>> to  void.
>>  This should probably change in the future.
>>  I also generate a new type whenever I see a pointer or array.
>>  This creates a lot of types but gdb seems happy with it.
>>  If I compile tcc with bounds-checking I see 1473 types.
>>  In the future types should be optimized.
>>  Can I apply this patch?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]