From aa45d18efc594052557f557f76f6f8b4aff08425 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 17 Dec 2025 18:21:27 +0000 Subject: [PATCH] build: add --debug-symbols to build with -g without enabling DCHECKs This is useful when debugging release builds on Linux without enabling DCHECKs. --- configure.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configure.py b/configure.py index 04a7db46856016..b31ecf5b34580a 100755 --- a/configure.py +++ b/configure.py @@ -107,6 +107,12 @@ default=None, help='build the Node.js part of the binary with debugging symbols') +parser.add_argument('--debug-symbols', + action='store_true', + dest='debug_symbols', + default=None, + help='add debugging symbols to release builds (adds -g without enabling DCHECKs)') + parser.add_argument('--dest-cpu', action='store', dest='dest_cpu', @@ -1560,6 +1566,9 @@ def configure_node(o): o['variables']['control_flow_guard'] = b(options.enable_cfg) o['variables']['node_use_amaro'] = b(not options.without_amaro) o['variables']['debug_node'] = b(options.debug_node) + o['variables']['debug_symbols'] = b(options.debug_symbols) + if options.debug_symbols: + o['cflags'] += ['-g'] o['variables']['build_type%'] = 'Debug' if options.debug else 'Release' o['default_configuration'] = 'Debug' if options.debug else 'Release' if options.error_on_warn and options.suppress_all_error_on_warn: