Skip to content

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

@gnidan

Description

@gnidan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions