-
Notifications
You must be signed in to change notification settings - Fork 756
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
Emit source map information for control flow structures #5524
Conversation
Hi Alon,
Regards |
@JesseCodeBones That does look like a real bug. Source maps support referring to the same source line from multiple places. And I agree it can happen in real-world code because sometimes a single source line ends up turned into multiple wasm lines, like you said. If you can find a fix that would be great! I think that is separate from this PR, though? I see the same results on that testcase with this PR or not. Does this PR look ok to you to land? |
cc @aheejin - not sure if you're familiar with this part of the debugging logic (it's source maps and not DWARF) but maybe you're interested in it too. |
yeah, I can handle it after this pr, it may take sometime and I have some personal issue to be handled, I suppose it is not an urgen or blocking issue |
Sounds good, thanks, and yes, this is not urgent of course. |
@@ -26,8 +26,9 @@ | |||
) | |||
|
|||
;; CHECK: (func $foo (param $x i32) (param $y i32) | |||
;; CHECK-NEXT: ;;@ src.cpp:20:1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not very familiar with this part of the code. A few questions:
- Why didn't we print the debug location for control flow structure before?
- It looks this
src.cpp:20:1
is the debug info for notif
buti32.add
, given that we didn't print debug info for control flow structures. Then why was it printed beforeif
and not beforei32.add
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I don't think anyone is very familiar with it 😄 It was written a long time ago (and not by me).
I can't see a reason for not printing it for control flow structures before. That might have just been an omission.
I'm not sure about the second question. I know there are some heuristics for how to print and emit stuff, that involve looking at recent instructions or such, so probably related to that?
Overall, my approach here considering this unfamiliar code is to get more tests on it, and improve on them. This PR seems to do that as after it we appear to perfectly roundtrip the input.
…5524) With this, the sourcemap testcase outputs the exact same thing as the input. Followup to WebAssembly#5504
With this, the sourcemap testcase outputs the exact same thing as the input.
Followup to #5504
cc @JesseCodeBones