Skip to content

Conversation

@linxuanm
Copy link
Contributor

@linxuanm linxuanm commented Jan 8, 2026

This PR cleans up the .gdb_init script and adds the vsreg command to print the value stack when given %vsp and %vfp (used in place of vsframe in SPC mode as the value stack bounds are not synced to the interpreter frame).

(gdb) vsreg $r11 $rsi

VFP = 0x7ffdf7f63000, VSP = 0x7ffdf7f630a0
Printing 5 stack values

@ 0x7ffdf7f63080:
  Tag:   0x64
  Value: 0x00000000 0x00000000 0x00000000 0x00000000
@ 0x7ffdf7f63060:
  Tag:   0x64
  Value: 0x00000000 0x00000000 0x00000000 0x00000000
@ 0x7ffdf7f63040:
  Tag:   0x64
  Value: 0x0841f0a0 0x00000000 0x00000000 0x00000000
@ 0x7ffdf7f63020:
  Tag:   0x7f
  Value: 0x0000002c 0x00000000 0x00000000 0x00000000
@ 0x7ffdf7f63000:
  Tag:   0x7e
  Value: 0x00000016 0x00000000 0x00000000 0x00000000

VALUE_SLOT_SIZE = 32
TAG_TO_VALUE_OFFSET = 16

FRAME_FIELDS = {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Can we make a little utility that when run uses the layout description to generate this part of the file? Then it could be part of the make system and automatically update this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be done with a Virgil script that includes the rest of Wizard as a dependency in order to get the offsets and tag configurations?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. A file like gdbgen.main.v3 that can be run to output the constants should suffice. Or it could be an option to the main wizeng binary to dump out the constants.

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