Skip to content

Commit 5f8ecf3

Browse files
joyeecheungaduh95
authored andcommitted
build: add --debug-symbols to build with -g without enabling DCHECKs
This is useful when debugging release builds on Linux without enabling DCHECKs. PR-URL: #61100 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent e5558b0 commit 5f8ecf3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

configure.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@
105105
default=None,
106106
help='build the Node.js part of the binary with debugging symbols')
107107

108+
parser.add_argument('--debug-symbols',
109+
action='store_true',
110+
dest='debug_symbols',
111+
default=None,
112+
help='add debugging symbols to release builds (adds -g without enabling DCHECKs)')
113+
108114
parser.add_argument('--dest-cpu',
109115
action='store',
110116
dest='dest_cpu',
@@ -1549,6 +1555,9 @@ def configure_node(o):
15491555
o['variables']['control_flow_guard'] = b(options.enable_cfg)
15501556
o['variables']['node_use_amaro'] = b(not options.without_amaro)
15511557
o['variables']['debug_node'] = b(options.debug_node)
1558+
o['variables']['debug_symbols'] = b(options.debug_symbols)
1559+
if options.debug_symbols:
1560+
o['cflags'] += ['-g']
15521561
o['default_configuration'] = 'Debug' if options.debug else 'Release'
15531562
if options.error_on_warn and options.suppress_all_error_on_warn:
15541563
raise Exception('--error_on_warn is incompatible with --suppress_all_error_on_warn.')

0 commit comments

Comments
 (0)