Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a tracing mode #2647

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Conversation

lum1n0us
Copy link
Collaborator

@lum1n0us lum1n0us commented Oct 16, 2023

It is a proposal to adding a tracing feature into all running modes for debug. Tracing mode is a light-weight debugging tool. It helps developers to quickly locate a bug in a few Wasm instructions range by checking operands. Operands of one opcode could be the result of previous closely opcode.

Currently, a tracing line includes | #<func_idx> | <opcode offset in a module> | <opcode naem> <imm info> <operads> . I am thinking adding local information.

| #00000004 | 00001234 | v128.store [align 0, offset 280]  0x00000914, 0x9a2ca4de15fe5524 0x96ad2e704036b443
| #00000004 | 00001234 | f32x4.max  0x966d3d29d7b33a11 0x96ad2e704036b443, 0x966d3d29d7b33a11 0x96ad2e704036b443
| #00000004 | 00001234 | v128.const 0x7fa8551de1a9c070 0x5bfba4b446e0c19a 
| #00000004 | 00001234 | i8x16.replace_lane [lane 0],  0xca8789a5b82a276f 0x399e66c0f340f34d, 0x00001de9
  • add a command line option to enable/disable tracing mode in both iwasm and wamrc
  • add offset (in the module file) information into output
  • use tables to replace all switch...case...
  • let interpreter support tracing
  • let jit support tracing
  • support more opcodes
  • call $imm prints parameters
  • return prints results
  • a tool to analyze callers and callees
  • a tool to analyze co-operations on same globals and memory bytes

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.

None yet

1 participant