Skip to content

Add a debugger feature to print 64-bit words in memory.#633

Open
ezrakilty wants to merge 1 commit into
titzer:masterfrom
wasmfx:debug-print-memory
Open

Add a debugger feature to print 64-bit words in memory.#633
ezrakilty wants to merge 1 commit into
titzer:masterfrom
wasmfx:debug-print-memory

Conversation

@ezrakilty

Copy link
Copy Markdown
Contributor

This one is a little underbaked as yet, but I wanted to share the idea already.

It should have:

  • The ability to print from other memories
  • The ability to print i32, i64, u32, u64 types at least. (Reading little-endian int data out of hex digits is 🤡 )

But maybe you have some ideas what the interface should be for selecting those? I was thinking maybe p [<memory>] [<type>] <address> where is the index of the memory object, and would default to 0. And could be e.g. i32, etc, or it could be raw or hex or something to indicate you want the raw bytes in hex. It would default to raw.

I must say, these two debugger features I'm PRing were crucial to pinning down my vexing bug in the Go compiler today. I was finally able to inspect the shadow stack at each point and see where I was going wrong. 🙏

@titzer

titzer commented May 11, 2026

Copy link
Copy Markdown
Owner

Nice! One idea would be to try to mirror the usage of the x command in gdb (https://visualgdb.com/gdbreference/commands/x). That'd be useful for people who have a gdb background to transfer skills. Wdyt?

@ezrakilty

Copy link
Copy Markdown
Contributor Author

Yeah, I would try to mimic gdb. I'll just have to refresh my memory what gdb actually does 😅 I'll get back to this!

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.

2 participants