Introduce debugging symbols #915
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "ghallak/ann-fate-ops"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Created by: radrow
Why lookup all?
Created by: radrow
There should be annotation to the occurence of
state
variable. This applies to all builtins, so maybe resolution of builtin variables should be adjusted.Created by: radrow
Ann should point to
put
, not to the argumentCreated by: radrow
Should take annotations
Created by: radrow
Why not list only the needed ones?
Created by: radrow
I would split it two lines, as you are doing two things in one line: saving argument locations and marking function entry
Created by: radrow
To consider: maybe
push
could takeAnn
and take care ofdbg_loc
itself?Created by: radrow
Also applies to similar instructions
Created by: radrow
Can you remind me why we don't keep column number?
Created by: radrow
I don't think you need a
dbg_loc
here, as it will be added bytuple
Created by: radrow
Would it work if I put a breakpoint on a case arrow?
Created by: radrow
Use
get_value/3
to handle defaultCreated by: radrow
what is
%
? Even if it's not your invention, I think it's frail to depend on how variables are named. I would use some{atom, _}
instead?Created by: radrow
How does it handle variables defined in cases or in alts? I mean,
Created by: radrow
Are subsequent
let
overwrites considered?Created by: radrow
There is a little issue with instructions that end basic blocks. As
DBG_UNDEF
is not anend_bb
instruction (and shouldn't be), it has to be called before the actual ending instruction. This may create a case in which we may prematurely loose information about variable locations:As I think it should not be an issue if
DBG_LOC
is always put beforeDBG_UNDEF
and always afterDBG_DEF
. I would double check if that's the case.We should look at it closer.
Created by: radrow
Pure
is used to mark instructions that don't alter the chain, so they can be moved around more freely. I think debug instructions should be consideredImpure
, so they are protected from compiler mangling.none
is fine, it means that the instruction does not write to anywhere nor alter our positionCreated by: radrow
Why not just check if only the last instruction is of the same loc?
Created by: radrow
At this point I would assume DBG_LOCs are added correctly, and we only want to get rid of redundancies.
Created by: radrow
Actually, do we have to hash anything when compiling with debug symbols?
Fixed here dca4466a9b9dd9830a1f941178068535ddfe16d3
Done here 59aecac0a1a8cefca29cfe96ab2086396e21ac4f
Fixed here 092eecc2ace01476ef47ae709e35853088ce437d
Changed to
Impure
here c721eccf11fed7bca418f411a249e849841db7beDone here e8975c8fd662a5e1d8ea7836e5bedb4803d71f20
Fixed here 85cc37e29463d2277b8193725b817882079e156c
Fixed here
85cc37e294
Fixed here
85cc37e294
It is not needed for setting breakpoints. Why should we have it?
Fixed here ee717c621c3b8846cda6b35aab51f2c18c207ea0
Why keep passing
Ann
down to functions that don't need it while we can end things into_scode1
?This is for fresh names (they have the form
%n
like%0
or%1
). We don't want to do haveDBG_DEF
andDBG_UNDEF
for this fresh names.I don't get your suggestion. Can you explain this more?
It will not work, but do we really need that?
Setting a breakpoint on the pattern (before the arrow) will cause a break before the first instruction after the arrow is executed.
In which case would you need to break before the instructions before the arrow are executed?
Do you mean checking for each
DBG_LOC
instruction at positionI
for the instruction at positionI - 1
?If that's what mean, then it would only work for the following case:
When multiple expressions are on the same line, the generated instructions would look like this:
This is why I had to use a
set
.Yes, there will be a
DBG_DEF
andDBG_UNDEF
for each of them:In which case would you see something like
RETURNR {var, 1}
? The return result is pushed to the stack andRETURN
is used instead ofRETURNR
most of the times.Can you point to an example that would produce the case that you're talking about?
I have just realized that there are no
DBG_DEF
andDBG_UNDEF
instructions for thex
that is to the left of the arrow. I will see if I can fix this.Created by: radrow
When you want to see what the pattern variables were bound to
Created by: radrow
If you have a complex expression such as
zeroth(first(), second(x), third(y) + 3215)
you may be able to put breakpoints more selectively. Here for example just beforesecond
is executed, when other functions can modify the state.But maybe let's leave it for later
Created by: radrow
Ah I see. Maybe then have a function to tell if a variable is fresh? This piece of code looks super random if you don't know it.
What I meant is to distinguish things like
{user_var, _}
and{system_var, _}
(naming whatever), so it would be clear that we are handling a variable added by the system. But I think having a function to check it based on name would be simpler for now.Created by: radrow
compiles to
I just want to be sure if we cover such cases properly. Even though we may not use
RETURNR
extensively now, we might use it later for whatever reason --- let's be prepared for such possibility.Created by: radrow
That's why I wanted columns, but fair for now
Done here ad382302f84c895f71d2ee9ad3e4d2e59b5b4f0d.
I'm turning off all optimizations including swap_push optimization for debugging compilation, so they won't happen, and the generated fate code won't have a
RETURNR arg0
. But it's something to consider in the future.Created by: radrow
If you insist on not covering it now, make at least an issue for that
This was solved here 959371e82467bc26a4f0af535c4dfd3a84a89bb4.
Created by: radrow
Make a release and reference it
Created by: radrow
Review: Commented
I would like to play with it in REPL before I approve. There are some issues there though, I can spend some time after it works. But otherwise it looks fine.
Created by: hanssv
FAnn or get_fann(Body)? This looks weird
Created by: hanssv
Review: Dismissed
Looks good 👍
Fixed this here 30def26aaeee27a6b3c7dd457c7d452fc9493b01.
Created by: radrow
Review: Approved
Created by: hanssv
Review: Approved
Merged by: ghallak at 2023-06-13 11:36:48 UTC