Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pointer references cannot rename the data regions generated by the template they reference #122

Open
gnidan opened this issue Dec 19, 2024 · 0 comments

Comments

@gnidan
Copy link
Member

gnidan commented Dec 19, 2024

Bit of background: the construct for referencing templates within a pointer is already a bit weird, designed in a way so as to minimize the complexity of each particular ethdebug/format/pointer/collection/* schema. It works by composing a reference collection inside a scope collection:

pointers:
  Template:
    # ethdebug/format/pointer/template
    expect: [expected-variable]
    in:
      name: template-region
      location: memory
      offset: expected-variable
      length: 32

# wrapper ethdebug/format/pointer/collection/scope
define:
  expected-variable: 5
for:
  # inner ethdebug/format/pointer/collection/reference
  template: Template

The expectation for debugger implementations is to aggregate a flat list of all the regions that are generated when observing runtime state; multiple regions of the same name are fine and recognized by the spec for real reasons (e.g. when pointing to all the items in an array, this naïve approach is sufficiently fine).

But if you want to reuse the same template multiple times, in multiple places (like inside a very large struct), this becomes extremely unwieldy.

It seems likely that the schema for these references will need to be expanded to accommodate the renaming of regions, similar to how some code that calls a reusable function gets to name the function's return values. This change will also require updating the reference implementation and its documentation.

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

No branches or pull requests

1 participant