-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Problem
Some Algorand developers have to go back-and-forth between PC numbers, Teal lines and puyapy/puya-ts source lines.
They are currently able to do this by processing the generated .map file (see ecma426). This is problematic usability-wise.
Solution
Provide a new debug-output that allows the developer to see all these mappings at-a-glance. This will not be enabled by default (as it is just to be used for personal debugging purposes and can be re-generated based on a compiled contract).
Proposal
The relevant actions that should be supported are:
- Search for a PC number (instruction aligned!) and see the corresponding teal line and source lines
- Search for a teal line and see the corresponding PC and source lines
- Search for a source line and see which teal and PCs implement it (may be zero due to an optimization, may be lots due to procedure inlining)
Aditionally it would be useful to have a hexdump for the contract, teal source and original source.
The proposed flag name is --disassembly-report because it will look like the output of objdump.
Another flag name can be chosen, the only limitation is that the name should not suggest that the format is to be consumed by a machine. This allows us to include more information later and to optimize it for human consumption.
For more info see: https://discord.com/channels/491256308461207573/1466662234418581594
Pros & Cons
No response
Dependencies
No response