Skip to content

debugging/stepping #14

Closed
Closed
@oli-obk

Description

@oli-obk

I'd like to use miri to step through code like in a debugger. At first I thought it would make sense to restructure miri so the interpreter ends up looping over an iterator that does the actual processing. But now I wonder if it would make sense to insert "hooks" into random places inside the interpreter, which a caller to the interpreter could attach to. So basically the interpreter runs in a thread and whenever it encounters a hook-place, it checks for a hook and if one is there, starts interacting with it.

The hook has a few options available:

  • obtain information about a stack frame
  • obtain the stack frame list
  • read the memory behind a pointer
  • execute an arbitrary MIR statement.
  • stop the interpreter
  • allow the interpreter to continue
  • add/remove hooks
  • step to the next hook-place

Possible hook-places:

  • reaching a file:line (requires checking spans in the interpreter)
  • changes a memory location gotten during another hook-processing
  • interpretation errors (unknown intrinsic, overflow, UB)

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions