tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Creating a debugger for my own language, in TinyCC?


From: John Smith
Subject: Re: [Tinycc-devel] Creating a debugger for my own language, in TinyCC?
Date: Tue, 6 Jan 2015 09:46:43 +0000

> If debugger information is available (I simply don't recall) then you
> could open that particular section (note that every OS has a different
> procedure for this) and parse it for the info that you want.
> 
> Otherwise, TinyCC doesn't currently support anything noteworthy on this 
> subject.

I was hoping for something like this... OK let's assume a function like this:

        void Func (int* a, int* b) {
                int c = 2 + a[0];
                if (a==b) {
                        int e = c * b[0];
                        a[0] = e;
                }
                int d = a[0] + b[0];
                return d + 1;
        }

So... Some kind of "Debug info" to say this:

        DEBUG INFO: "Func"
        a 0   0
        b 4   0
        c 8   10  20
        e 12  16  10
        d 12  20  4

Something really simple like that.

For example if you read "c", it means:

        'For the function called "func" '...

        There exists a variable on the stack... named "c" that relative to the 
function's stack pointer... is 8 bytes ahead.

        And... it is "fully initialised" when the "program counter" is 10 bytes 
into the function's code.

        And... it exists for 20 bytes length of program counter space.

You'll notice the params "a" & "b", exist at 0 bytes into the function's code 
(I don't know if that's true but that's what I guessed.)

Also that "e" and "d" use the same register offset... because "e"'s scope 
actually ends, so it's position is re-used for "d".






reply via email to

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