Skip to content

Add BYN_DEBUG/BYN_TRACE macros similar to LLVM's debug system#2496

Merged
sbc100 merged 5 commits intomasterfrom
add_debug_macro
Dec 4, 2019
Merged

Add BYN_DEBUG/BYN_TRACE macros similar to LLVM's debug system#2496
sbc100 merged 5 commits intomasterfrom
add_debug_macro

Conversation

@sbc100
Copy link
Copy Markdown
Member

@sbc100 sbc100 commented Dec 4, 2019

This allows for debug trace message to be split my channel. So you
can pass --debug to simply debug everything, or --debug-only=opt
to only debug wasm-opt.

This change is the initial introduction but as a followup I hope to
convert all tracing over to this new system so we can more easily
control the debug output.

This allows for debug trace message to be split my channel.  So you
can pass `--debug` to simply debug everything, or `--debug-only=opt`
to only debug wasm-opt.

This change is the initial introduction but as a followup I hope to
convert all tracing over to this new system so we can more easily
control the debug output.
@sbc100 sbc100 requested review from kripken and tlively December 4, 2019 02:49
Copy link
Copy Markdown
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

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

This looks great! I like the use of the BYN_* prefix, and I think we should change WASM_UNREACHABLE to be BYN_UNREACHABLE for consistency as a followup.

Comment thread src/support/debug.h Outdated
// To use these macros you must define DEBUG_TYPE to a C string within your
// source code which then acts as the name of a channel which can be
// individually enabled via --debug=<chan>. Specifing --debug without any
// argument enabled all channels.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// argument enabled all channels.
// argument enables all channels.

@sbc100
Copy link
Copy Markdown
Member Author

sbc100 commented Dec 4, 2019

Checkout the followup PR that simplifies a lot of the debug handling: #2497

@sbc100 sbc100 merged commit f346478 into master Dec 4, 2019
@kripken kripken deleted the add_debug_macro branch December 4, 2019 21:01
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