Skip to main content

Dereferencing pointers

An implementation guide for resolving ethdebug/format/pointers into concrete regions and values in a running EVM.

Introduction

This implementation guide describes the @ethdebug/pointers reference implementation, written in TypeScript and intended for distribution as an NPM package.

Debuggers looking to support ethdebug/format must be prepared to dereference the data allocations used by compilers for all kinds of variables. Compilers for EVM languages tend to use novel techniques for allocating data, and, as a result, compile-time descriptions of these allocations require an expressive syntax.

This format's ethdebug/format/pointer schema provides such suitable expressiveness, but implementing the logic to read and evaluate data in this schema requires some careful consideration.

tip

If you're reading this page without first having familiarized yourself with the concepts/terminology defined by the ethdebug/format/pointer schema, it is recommended that you start by reading the Key concepts page and then study the handful of example pointers provided by the schema itself.

A fully-detailed understanding of the schema is not necessary for the purposes of understanding these docs, although if certain concepts are unclear, please raise the concern in a GitHub issue.

How this guide is organized

These docs seek to provide a guide for implementing ethdebug/format/pointer logic by way of outlining and listing the code for an example implementation. These pages are ordered so that more primitive components are introduced and described before the more complex components built upon them.

A suggestion to readers who like to skip ahead: you might want to read or skim the Essential type definitions pages to familiarize yourself with the nouns that this implementation employs.