Skip to content

Commit 8f5da64

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

File tree

4 files changed

+181
-0
lines changed

4 files changed

+181
-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: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
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+
'defines': [
62+
'BUILDING_V8_DEBUG_HELPER'
63+
],
64+
'sources': [
65+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/tools/debug_helper/BUILD.gn" "\"v8_debug_helper_internal\".*?sources = ")',
66+
"<(SHARED_INTERMEDIATE_DIR)/torque-generated/class-debug-readers.cc",
67+
"<(SHARED_INTERMEDIATE_DIR)/torque-generated/class-debug-readers.h",
68+
"<(SHARED_INTERMEDIATE_DIR)/torque-generated/debug-macros.cc",
69+
"<(SHARED_INTERMEDIATE_DIR)/torque-generated/debug-macros.h",
70+
"<(SHARED_INTERMEDIATE_DIR)/torque-generated/instance-types.h",
71+
],
72+
'conditions': [
73+
# Enable RTTI //build/config/compiler:rtti
74+
[ 'os_posix == 1 and OS != "mac" and OS != "ios"', {
75+
'cflags_cc': [ '-frtti' ],
76+
'cflags_cc!': [ '-fno-rtti' ],
77+
}],
78+
[ 'OS == "mac" or OS == "ios"', {
79+
'xcode_settings': {'GCC_ENABLE_CPP_RTTI': 'YES' },
80+
}],
81+
[ 'OS == "win"', {
82+
'msvs_settings': {
83+
'VCCLCompilerTool': {'RuntimeTypeInfo': 'true'},
84+
}
85+
}],
86+
],
87+
}, # v8_debug_helper
88+
{
89+
'target_name': 'gen_heap_constants',
90+
'type': 'none',
91+
'hard_dependency': 1,
92+
'dependencies': [
93+
'run_mkgrokdump',
94+
],
95+
'direct_dependent_settings': {
96+
'sources': [
97+
'<(SHARED_INTERMEDIATE_DIR)/heap-constants-gen.cc',
98+
],
99+
},
100+
'actions': [
101+
{
102+
'action_name': 'run_gen_heap_constants',
103+
'inputs': [
104+
'<(V8_ROOT)/tools/debug_helper/gen-heap-constants.py',
105+
],
106+
'outputs': [
107+
'<(SHARED_INTERMEDIATE_DIR)/heap-constants-gen.cc',
108+
],
109+
'action': [
110+
'<(python)',
111+
'<(V8_ROOT)/tools/debug_helper/gen-heap-constants.py',
112+
'<(SHARED_INTERMEDIATE_DIR)',
113+
'<@(_outputs)',
114+
]
115+
}
116+
]
117+
}, # gen_heap_constants
118+
{
119+
'target_name': 'run_mkgrokdump',
120+
'type': 'none',
121+
'hard_dependency': 1,
122+
'dependencies': [
123+
'mkgrokdump',
124+
],
125+
'actions': [
126+
{
127+
'action_name': 'run_gen_heap_constants',
128+
'inputs': [
129+
'<(V8_ROOT)/tools/run.py',
130+
],
131+
'outputs': [
132+
'<(SHARED_INTERMEDIATE_DIR)/v8heapconst.py',
133+
],
134+
'action': [
135+
'<(python)',
136+
'<(V8_ROOT)/tools/run.py',
137+
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mkgrokdump<(EXECUTABLE_SUFFIX)',
138+
'--outfile',
139+
'<@(_outputs)',
140+
]
141+
}
142+
]
143+
}, # run_mkgrokdump
144+
{
145+
'target_name': 'mkgrokdump',
146+
'type': 'executable',
147+
'include_dirs': [
148+
'<(V8_ROOT)',
149+
'<(V8_ROOT)/include',
150+
],
151+
'dependencies': [
152+
'abseil.gyp:abseil',
153+
'v8.gyp:v8_snapshot',
154+
'v8.gyp:v8_libbase',
155+
'v8.gyp:v8_libplatform',
156+
'v8.gyp:v8_maybe_icu',
157+
'v8.gyp:fp16',
158+
'v8.gyp:generate_bytecode_builtins_list',
159+
'v8.gyp:run_torque',
160+
],
161+
'sources': [
162+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/test/mkgrokdump/BUILD.gn" "mkgrokdump.*?sources = ")',
163+
]
164+
}, # mkgrokdump
165+
],
166+
}

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)