Skip to content

bugc: add declaration source ranges and param names to call contexts#196

Merged
gnidan merged 1 commit intocall-returnfrom
compiler-declaration-contexts
Apr 1, 2026
Merged

bugc: add declaration source ranges and param names to call contexts#196
gnidan merged 1 commit intocall-returnfrom
compiler-declaration-contexts

Conversation

@gnidan
Copy link
Copy Markdown
Member

@gnidan gnidan commented Apr 1, 2026

Summary

  • Invoke and return contexts now include declaration source ranges pointing to the function definition in source
  • Argument group pointers now include parameter names from the function signature
  • Adds loc/sourceId to Ir.Function and threads module function metadata through EVM codegen

This enriches debug info so debuggers can link call stack entries to source declarations and display meaningful parameter names alongside argument values.

…contexts

The invoke and return contexts emitted by bugc now include
declaration source ranges (pointing to the function definition)
and named argument pointers (using parameter names from the
function signature). This enriches debug info so debuggers can
link call stack entries to source declarations and display
meaningful parameter names.

Changes:
- Add loc/sourceId fields to Ir.Function, populated during
  IR generation from AST function declarations
- Thread module.functions map through EVM codegen so call
  terminators can look up target function metadata
- Build declaration source ranges on invoke contexts (caller
  JUMP, callee entry JUMPDEST) and return contexts
  (continuation JUMPDEST)
- Add parameter names to argument group pointers
- Update call-contexts tests for new fields
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://ethdebug.github.io/format/pr-preview/pr-196/

Built to branch gh-pages at 2026-04-01 20:39 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@gnidan gnidan merged commit a2cfb35 into call-return Apr 1, 2026
4 checks passed
@gnidan gnidan deleted the compiler-declaration-contexts branch April 1, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant