Skip to content

Convert to using DEBUG macros#2497

Merged
sbc100 merged 2 commits intomasterfrom
use_debug_macros
Dec 4, 2019
Merged

Convert to using DEBUG macros#2497
sbc100 merged 2 commits intomasterfrom
use_debug_macros

Conversation

@sbc100
Copy link
Copy Markdown
Member

@sbc100 sbc100 commented Dec 4, 2019

This means that debugging/tracing can now be enabled and controlled
centrally without managing and passing state around the codebase.

This means that debugging/tracing can now be enabled and controlled
centrally without managing and passing state around the codebase.
@sbc100 sbc100 changed the base branch from add_debug_macro to master December 4, 2019 08:21
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.

Very nice!

Comment thread src/wasm-binary.h
std::cerr << "writeU32LEB: " << x.value << " (at " << before << ")"
<< std::endl;
}
BYN_DEBUG(before = size(); std::cerr << "writeU32LEB: " << x.value
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.

It's a little strange that the debug statement has a side effect of assigning to before here. It looks like before is only used inside the BYN_DEBUG code, so I think removing it and just using size() would be a good simplification. The same goes for the other before variables in subsequent functions.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I had a go, but the second debug block wants to use the old size before

@sbc100 sbc100 merged commit 19d929c into master Dec 4, 2019
@sbc100 sbc100 deleted the use_debug_macros branch December 4, 2019 19:09
sbc100 added a commit that referenced this pull request Dec 4, 2019
This like was mistakenly removed as part of the BYN_TRACE conversion.
sbc100 added a commit that referenced this pull request Dec 4, 2019
This like was mistakenly removed as part of the BYN_TRACE conversion.
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