Skip to content

Enable debug mode on BUILD=debug#6898

Merged
WalterBright merged 2 commits intodlang:masterfrom
wilzbach:enable-debug
Aug 12, 2017
Merged

Enable debug mode on BUILD=debug#6898
WalterBright merged 2 commits intodlang:masterfrom
wilzbach:enable-debug

Conversation

@wilzbach
Copy link
Contributor

I expected make -f posix.mak BUILD=debug to work out of the box and generate a debug build of the compiler (with debug info!).

@CyberShadow
Copy link
Member

I'm not sure these are equivalent. CC @yebblies

@wilzbach
Copy link
Contributor Author

I'm not sure these are equivalent. CC @yebblies

ENABLE_DEBUG adds the debug flags:

 ifdef ENABLE_DEBUG
 CXXFLAGS += -g -g3 -DDEBUG=1 -DUNITTEST		 CXXFLAGS += -g -g3 -DDEBUG=1 -DUNITTEST
 DFLAGS += -g -debug -unittest		 DFLAGS += -g -debug -unittest
 endif		 endif

whereas BUILD=debug just changes the folder (from what I can tell).

@Burgos
Copy link
Contributor

Burgos commented Jun 16, 2017

Yes, I was surprised by this behavior the other day as well.

src/posix.mak Outdated
ifneq ($(BUILD),debug)
$(error Unrecognized BUILD=$(BUILD), must be 'debug' or 'release')
endif
ENABLE_DEBUG := 1
Copy link
Contributor

Choose a reason for hiding this comment

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

tabs vs. spaces as in the rest of the 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.

There's no consistent style:

image

image

image

...

@WalterBright
Copy link
Member

Please add documentation about what this does to the makefile, not just here.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @wilzbach!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

@wilzbach
Copy link
Contributor Author

Please add documentation about what this does to the makefile, not just here.

This Makefile was more or less undocumented, so I started an attempt to document it.

@wilzbach
Copy link
Contributor Author

As no one objected for the last two months, can we move forward with this trivial improvement?

@JinShil
Copy link
Contributor

JinShil commented Aug 12, 2017

I ran into this confusion just the other day, so this PR is most welcome. LGTM.

################################################################################
# Important variables:
# --------------------
#
Copy link
Member

Choose a reason for hiding this comment

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

The formatting is off on these comments - perhaps you're using tabs?

#
# HOST_CSS: Host C++ compiler to use (g++,clang++)
# HOST_DMD: Host D compiler to use for bootstrapping
# AUTO_BOOTSTRAP: Enable auto-boostrapping by download a stable DMD binary
Copy link
Member

Choose a reason for hiding this comment

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

s/download/downloading/

################################################################################
# Build modes:
# ------------
# BUILD: release (default) | debug (enabled a build with debug symbols)
Copy link
Member

Choose a reason for hiding this comment

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

Probably ought to say that this is intended to be set on the command line

@WalterBright WalterBright merged commit 200bef3 into dlang:master Aug 12, 2017
@wilzbach wilzbach deleted the enable-debug branch December 1, 2017 05:19
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.

6 participants

Comments