feat: add internal spec for debug-info - #16780
Conversation
|
@nikola-matic I fixed the build and here is the Thank you! |
9fd16e7 to
d08f715
Compare
cameel
left a comment
There was a problem hiding this comment.
Here's a bunch of remarks from the first reading through the spec. I'm not done yet so I'll likely have more later.
822d2e3 to
a8785c2
Compare
1af126d to
5e4b1de
Compare
cameel
left a comment
There was a problem hiding this comment.
Sorry for the delay. Here's another batch of remarks. The spec is much better now, containing a lot of detail that was missing before. I think there are still some holes in it though.
37b9141 to
1460456
Compare
605588c to
c1988bb
Compare
|
Some remarks regarding the scope of this implementation spec. Back when we were preparing the implementation plan for ethdebug I expected that this document would end up being much more detailed, and already free us from most design choices upfront. Then you'd be able to focus on implementation without major blockers. That was a bit too ambitious, so I'm fine with just focusing on fleshing out the Yul sidecar format here. Once that's done, we can merge the PR. I'll post my more specific comments in a moment. As for the final form of the spec/docs, we can move towards that in further PRs and in the meantime you can work on implementing the bits that are already documented and agreed on. More concretely, here's what I have in mind for the full scope:
For the user-facing docs, I'd create a dedicated page for debug info (not just ethdebug, everything related to how debug info works in Solidity and Yul). For implementation docs we do not have a good place yet, so let's create one. I really don't see it as a part of the current topic hierarchy, it's too low level and meant for a different audience, so my suggestion is to create a separate TOC tree on a new page that's not reachable from the current TOC. We can later think how to expose it, but just being able to get there if you know the link would be enough for now. To be clear - you don't have to do that in this PR yet. The current document mixes the two categories and that's fine for now. I see it more as an initial draft. Please just remove the page from the TOC and make it an orphan so that it's not exposed to users yet. You already have a lot of this info, but in the final form I'd like to see more detail. Especially on the implementation doc side - the idea was for this to be a high-level description of what you're going to do in the PRs. And I'm mostly interested in reviewing that and leaving smaller details up to you and @nikola-matic. |
cameel
left a comment
There was a problem hiding this comment.
Here's the final batch of substantial comments about the content. Once we get through these, we're done with the hard stuff.
I'll also have a few more trivial ones (naming, formattiong), but those should be pretty easy to address. I intentionally left them for the end.
c1988bb to
1e39e2c
Compare
I strongly believe that this spec is a live thing, and that changing it in future is inevitable. So, yeah, I do agree that it can be our final goal!
Yes, we are on the same page! |
|
@cameel thank you! |
There was a problem hiding this comment.
Here's another batch of comments. At this point I think we have all the major issues in the format resolved so it's mostly about small technical details and clarifications.
Please also recheck my earlier, still unresolved comment threads. It seems that there are 2 or 3 at the beginning that you missed.
| ``SSATransform`` and ``Rematerialiser`` cannot be expressed as whole-scope updates, because the pointer or phase changes between program points. | ||
| They must emit variable updates instead - see `Variable Updates`_. | ||
| Substituting a variable use by its defining expression can leave the variable itself unused and later pruned. | ||
| The value is then still recoverable by evaluating that expression, so its phase becomes ``Computed`` rather than ``OptimizedOut``. |
There was a problem hiding this comment.
So just to be clear: we don't provide any detailed information on how to recover a value of a "computed" variable. The debugger has to figure it out on its own?
Does the final ethdebug output actually contain any breadcrumbs for the debugger? nativeLocation of the expression I guess? Or some range of instructions in the bytecode that compute it?
There was a problem hiding this comment.
Well, we must talk about this on the ethdebug call. There is no recipe, the debugger will show a computed value as unavailable, same as optimizedOut atm. The distinction is about truthfulness: recomputable in principle vs. definitely gone. And no real breadcrumbs to promise either, instruction-to-source mapping exists anyway, but re-evaluating the source expression is debugger heuristics, not something the format guarantees. The proper fix would be value expressions in the DWARF sense (DW_OP_stack_value), but ethdebug pointers only describe regions today, so that's an upstream schema extension. Clarified the computed row and added a note about exactly this.
There was a problem hiding this comment.
ok. Definitely sounds like we should discuss it on the call. Can you also file an upstream issue about it? This would give us a place to discuss it async.
cameel
left a comment
There was a problem hiding this comment.
There's one minor remark left (#16780 (comment)).
Other than that, this looks ready. Great work!
The last thing is to clean up the commits (fine to squash into one, unless you see the need for more structure here) and then we can proceed with merging.
This introduces the compiler-side model for carrying Solidity semantic debug info through the Yul pipeline, including AST-ID based reattachment across Yul reparse. See docs/internals/ethdebug_internal_debug_info.rst for more detailed explanation of the design.
1a018af to
064b70c
Compare
Thanks a lot for your comments! |
cameel
left a comment
There was a problem hiding this comment.
ok then, let's ship it :)
This introduces the compiler-side model for carrying Solidity semantic debug info through the Yul pipeline, including AST-ID based reattachment across Yul reparse.
See
docs/internals/ethdebug_internal_debug_info.rstfor more detailed explanation of the design.