Skip to content

Commit d6f966f

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

File tree

4 files changed

+152
-0
lines changed

4 files changed

+152
-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: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
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.
12+
'target_name': 'build_v8windbg',
13+
'type': 'none',
14+
'hard_dependency': 1,
15+
'dependencies': [
16+
'v8windbg',
17+
],
18+
},
19+
{
20+
'target_name': 'v8windbg',
21+
'type': 'shared_library',
22+
'include_dirs+': [
23+
'<(V8_ROOT)',
24+
'<(V8_ROOT)/include',
25+
],
26+
'dependencies': [
27+
'gen_heap_constants',
28+
29+
'abseil.gyp:abseil',
30+
'v8.gyp:generate_bytecode_builtins_list',
31+
'v8.gyp:run_torque',
32+
'v8.gyp:v8_maybe_icu',
33+
'v8.gyp:fp16',
34+
'v8.gyp:v8_libbase',
35+
'v8.gyp:v8_snapshot',
36+
],
37+
'defines': [
38+
'BUILDING_V8_DEBUG_HELPER'
39+
],
40+
'sources': [
41+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/tools/v8windbg/BUILD.gn" "v8windbg_base.*?sources = ")',
42+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/tools/v8windbg/BUILD.gn" "v8_shared_library..v8windbg.*?sources = ")',
43+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/tools/debug_helper/BUILD.gn" "\"v8_debug_helper_internal\".*?sources = ")',
44+
"<(SHARED_INTERMEDIATE_DIR)/torque-generated/class-debug-readers.cc",
45+
"<(SHARED_INTERMEDIATE_DIR)/torque-generated/class-debug-readers.h",
46+
"<(SHARED_INTERMEDIATE_DIR)/torque-generated/debug-macros.cc",
47+
"<(SHARED_INTERMEDIATE_DIR)/torque-generated/debug-macros.h",
48+
"<(SHARED_INTERMEDIATE_DIR)/torque-generated/instance-types.h",
49+
],
50+
"link_settings": {
51+
"libraries": [
52+
"-lDbgEng.lib",
53+
"-lDbgModel.lib",
54+
"-lRuntimeObject.lib",
55+
"-lcomsuppwd.lib",
56+
],
57+
},
58+
},
59+
{
60+
'target_name': 'gen_heap_constants',
61+
'type': 'none',
62+
'hard_dependency': 1,
63+
'dependencies': [
64+
'run_mkgrokdump',
65+
],
66+
'direct_dependent_settings': {
67+
'sources': [
68+
'<(SHARED_INTERMEDIATE_DIR)/heap-constants-gen.cc',
69+
],
70+
},
71+
'actions': [
72+
{
73+
'action_name': 'run_gen_heap_constants',
74+
'inputs': [
75+
'<(V8_ROOT)/tools/debug_helper/gen-heap-constants.py',
76+
],
77+
'outputs': [
78+
'<(SHARED_INTERMEDIATE_DIR)/heap-constants-gen.cc',
79+
],
80+
'action': [
81+
'<(python)',
82+
'<(V8_ROOT)/tools/debug_helper/gen-heap-constants.py',
83+
'<(SHARED_INTERMEDIATE_DIR)',
84+
'<@(_outputs)',
85+
]
86+
}
87+
]
88+
},
89+
{
90+
'target_name': 'run_mkgrokdump',
91+
'type': 'none',
92+
'hard_dependency': 1,
93+
'dependencies': [
94+
'mkgrokdump',
95+
],
96+
'actions': [
97+
{
98+
'action_name': 'run_gen_heap_constants',
99+
'inputs': [
100+
'<(V8_ROOT)/tools/run.py',
101+
],
102+
'outputs': [
103+
'<(SHARED_INTERMEDIATE_DIR)/v8heapconst.py',
104+
],
105+
'action': [
106+
'<(python)',
107+
'<(V8_ROOT)/tools/run.py',
108+
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mkgrokdump<(EXECUTABLE_SUFFIX)',
109+
'--outfile',
110+
'<@(_outputs)',
111+
]
112+
}
113+
]
114+
},
115+
{
116+
'target_name': 'mkgrokdump',
117+
'type': 'executable',
118+
'include_dirs': [
119+
'<(V8_ROOT)',
120+
'<(V8_ROOT)/include',
121+
],
122+
'dependencies': [
123+
'abseil.gyp:abseil',
124+
'v8.gyp:v8_snapshot',
125+
'v8.gyp:v8_libbase',
126+
'v8.gyp:v8_libplatform',
127+
'v8.gyp:v8_maybe_icu',
128+
'v8.gyp:fp16',
129+
'v8.gyp:generate_bytecode_builtins_list',
130+
'v8.gyp:run_torque',
131+
],
132+
'sources': [
133+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/test/mkgrokdump/BUILD.gn" "mkgrokdump.*?sources = ")',
134+
]
135+
},
136+
],
137+
}

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)