Skip to content

Commit b845452

Browse files
committed
tools: add v8windbg target
1 parent 9b0e9f4 commit b845452

File tree

4 files changed

+174
-0
lines changed

4 files changed

+174
-0
lines changed

configure.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,12 @@
628628
default=None,
629629
help=argparse.SUPPRESS) # Unsupported, undocumented.
630630

631+
parser.add_argument('--enable-v8windbg',
632+
action='store_true',
633+
dest='enable_v8windbg',
634+
default=None,
635+
help=argparse.SUPPRESS) # Undocumented.
636+
631637
parser.add_argument('--enable-trace-maps',
632638
action='store_true',
633639
dest='trace_maps',
@@ -1798,10 +1804,13 @@ def configure_v8(o, configs):
17981804
o['variables']['node_use_bundled_v8'] = b(not options.without_bundled_v8)
17991805
o['variables']['force_dynamic_crt'] = 1 if options.shared else 0
18001806
o['variables']['node_enable_d8'] = b(options.enable_d8)
1807+
o['variables']['node_enable_v8windbg'] = b(options.enable_v8windbg)
18011808
if options.enable_d8:
18021809
o['variables']['test_isolation_mode'] = 'noop' # Needed by d8.gyp.
18031810
if options.without_bundled_v8 and options.enable_d8:
18041811
raise Exception('--enable-d8 is incompatible with --without-bundled-v8.')
1812+
if options.without_bundled_v8 and options.enable_v8windbg:
1813+
raise Exception('--enable-v8windbg is incompatible with --without-bundled-v8.')
18051814
if options.static_zoslib_gyp:
18061815
o['variables']['static_zoslib_gyp'] = options.static_zoslib_gyp
18071816
if flavor != 'linux' and options.v8_enable_hugepage:

node.gypi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@
8585
[ 'node_enable_d8=="true"', {
8686
'dependencies': [ 'tools/v8_gypfiles/d8.gyp:d8' ],
8787
}],
88+
[ 'node_enable_v8windbg=="true"', {
89+
'dependencies': [ 'tools/v8_gypfiles/v8windbg.gyp:build_v8windbg' ],
90+
}],
8891
[ 'node_use_bundled_v8=="true"', {
8992
'dependencies': [
9093
'tools/v8_gypfiles/v8.gyp:v8_snapshot',

tools/v8_gypfiles/v8windbg.gyp

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
{
2+
'variables': {
3+
'V8_ROOT': '../../deps/v8',
4+
'v8_code': 1,
5+
},
6+
'includes': ['toolchain.gypi', 'features.gypi'],
7+
'targets': [
8+
{
9+
# Intermediate target to build v8windbg.dll.
10+
# This prevents the dependent settings like node.gypi to link the v8windbg.dll
11+
# to the dependent. v8windbg.dll is only supposed to be loaded by WinDbg at debug time.
12+
'target_name': 'build_v8windbg',
13+
'type': 'none',
14+
'hard_dependency': 1,
15+
'dependencies': [
16+
'v8windbg',
17+
],
18+
}, # build_v8windbg
19+
{
20+
'target_name': 'v8windbg',
21+
'type': 'shared_library',
22+
'include_dirs': [
23+
'<(V8_ROOT)',
24+
'<(V8_ROOT)/include',
25+
],
26+
'dependencies': [
27+
'v8_debug_helper',
28+
'v8.gyp:v8_libbase',
29+
],
30+
'sources': [
31+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/tools/v8windbg/BUILD.gn" "v8windbg_base.*?sources = ")',
32+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/tools/v8windbg/BUILD.gn" "v8_shared_library..v8windbg.*?sources = ")',
33+
],
34+
"link_settings": {
35+
"libraries": [
36+
"-lDbgEng.lib",
37+
"-lDbgModel.lib",
38+
"-lRuntimeObject.lib",
39+
"-lcomsuppwd.lib",
40+
],
41+
},
42+
}, # v8windbg
43+
{
44+
'target_name': 'v8_debug_helper',
45+
'type': 'static_library',
46+
'include_dirs': [
47+
'<(V8_ROOT)',
48+
'<(V8_ROOT)/include',
49+
],
50+
'dependencies': [
51+
'gen_heap_constants',
52+
53+
'abseil.gyp:abseil',
54+
'v8.gyp:generate_bytecode_builtins_list',
55+
'v8.gyp:run_torque',
56+
'v8.gyp:v8_maybe_icu',
57+
'v8.gyp:fp16',
58+
'v8.gyp:v8_libbase',
59+
'v8.gyp:v8_snapshot',
60+
],
61+
'sources': [
62+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/tools/debug_helper/BUILD.gn" "\"v8_debug_helper_internal\".*?sources = ")',
63+
"<(SHARED_INTERMEDIATE_DIR)/torque-generated/class-debug-readers.cc",
64+
"<(SHARED_INTERMEDIATE_DIR)/torque-generated/class-debug-readers.h",
65+
"<(SHARED_INTERMEDIATE_DIR)/torque-generated/debug-macros.cc",
66+
"<(SHARED_INTERMEDIATE_DIR)/torque-generated/debug-macros.h",
67+
"<(SHARED_INTERMEDIATE_DIR)/torque-generated/instance-types.h",
68+
],
69+
# Enable RTTI //build/config/compiler:rtti
70+
'cflags_cc': [ '-frtti' ],
71+
'cflags_cc!': [ '-fno-rtti' ],
72+
'xcode_settings': {
73+
'GCC_ENABLE_CPP_RTTI': 'YES', # -frtti
74+
},
75+
'msvs_settings': {
76+
'VCCLCompilerTool': {
77+
'RuntimeTypeInfo': 'true',
78+
},
79+
},
80+
}, # v8_debug_helper
81+
{
82+
'target_name': 'gen_heap_constants',
83+
'type': 'none',
84+
'hard_dependency': 1,
85+
'dependencies': [
86+
'run_mkgrokdump',
87+
],
88+
'direct_dependent_settings': {
89+
'sources': [
90+
'<(SHARED_INTERMEDIATE_DIR)/heap-constants-gen.cc',
91+
],
92+
},
93+
'actions': [
94+
{
95+
'action_name': 'run_gen_heap_constants',
96+
'inputs': [
97+
'<(V8_ROOT)/tools/debug_helper/gen-heap-constants.py',
98+
],
99+
'outputs': [
100+
'<(SHARED_INTERMEDIATE_DIR)/heap-constants-gen.cc',
101+
],
102+
'action': [
103+
'<(python)',
104+
'<(V8_ROOT)/tools/debug_helper/gen-heap-constants.py',
105+
'<(SHARED_INTERMEDIATE_DIR)',
106+
'<@(_outputs)',
107+
]
108+
}
109+
]
110+
}, # gen_heap_constants
111+
{
112+
'target_name': 'run_mkgrokdump',
113+
'type': 'none',
114+
'hard_dependency': 1,
115+
'dependencies': [
116+
'mkgrokdump',
117+
],
118+
'actions': [
119+
{
120+
'action_name': 'run_gen_heap_constants',
121+
'inputs': [
122+
'<(V8_ROOT)/tools/run.py',
123+
],
124+
'outputs': [
125+
'<(SHARED_INTERMEDIATE_DIR)/v8heapconst.py',
126+
],
127+
'action': [
128+
'<(python)',
129+
'<(V8_ROOT)/tools/run.py',
130+
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mkgrokdump<(EXECUTABLE_SUFFIX)',
131+
'--outfile',
132+
'<@(_outputs)',
133+
]
134+
}
135+
]
136+
}, # run_mkgrokdump
137+
{
138+
'target_name': 'mkgrokdump',
139+
'type': 'executable',
140+
'include_dirs': [
141+
'<(V8_ROOT)',
142+
'<(V8_ROOT)/include',
143+
],
144+
'dependencies': [
145+
'abseil.gyp:abseil',
146+
'v8.gyp:v8_snapshot',
147+
'v8.gyp:v8_libbase',
148+
'v8.gyp:v8_libplatform',
149+
'v8.gyp:v8_maybe_icu',
150+
'v8.gyp:fp16',
151+
'v8.gyp:generate_bytecode_builtins_list',
152+
'v8.gyp:run_torque',
153+
],
154+
'sources': [
155+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/test/mkgrokdump/BUILD.gn" "mkgrokdump.*?sources = ")',
156+
]
157+
}, # mkgrokdump
158+
],
159+
}

vcbuild.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ set doc=
7272
set extra_msbuild_args=
7373
set compile_commands=
7474
set cfg=
75+
set v8windbg=
7576
set exit_code=0
7677

7778
:next-arg
@@ -95,6 +96,7 @@ if /i "%1"=="sign" set sign=1&goto arg-ok
9596
if /i "%1"=="nosnapshot" set nosnapshot=1&goto arg-ok
9697
if /i "%1"=="nonpm" set nonpm=1&goto arg-ok
9798
if /i "%1"=="ltcg" set ltcg=1&goto arg-ok
99+
if /i "%1"=="v8windbg" set v8windbg=1&goto arg-ok
98100
if /i "%1"=="licensertf" set licensertf=1&goto arg-ok
99101
if /i "%1"=="test" set test_args=%test_args% %common_test_suites%&set lint_cpp=1&set lint_js=1&set lint_md=1&goto arg-ok
100102
if /i "%1"=="test-ci-native" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap %CI_NATIVE_SUITES% %CI_DOC%&set build_addons=1&set build_js_native_api_tests=1&set build_node_api_tests=1&set cctest_args=%cctest_args% --gtest_output=xml:cctest.junit.xml&goto arg-ok
@@ -210,6 +212,7 @@ if defined DEBUG_HELPER set configure_flags=%configure_flags% --verbose
210212
if defined ccache_path set configure_flags=%configure_flags% --use-ccache-win
211213
if defined compile_commands set configure_flags=%configure_flags% -C
212214
if defined cfg set configure_flags=%configure_flags% --control-flow-guard
215+
if defined v8windbg set configure_flags=%configure_flags% --enable-v8windbg
213216

214217
if "%target_arch%"=="x86" (
215218
echo "32-bit Windows builds are not supported anymore."

0 commit comments

Comments
 (0)