Skip to content

Remove fastcomp-only CYBERDWARF option #11865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 3 additions & 19 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def flush(self, title='js_opts'):
def run_passes(self, passes, title, just_split, just_concat):
global final
passes = ['asm'] + passes
if (self.emit_symbol_map or shared.Settings.CYBERDWARF) and 'minifyNames' in passes:
if self.emit_symbol_map and 'minifyNames' in passes:
passes += ['symbolMap=' + shared.replace_or_append_suffix(self.target, '.symbols')]
if self.profiling_funcs and 'minifyNames' in passes:
passes += ['profilingFuncs']
Expand Down Expand Up @@ -929,7 +929,7 @@ def optimizing(opts):
return '-O0' not in opts

def need_llvm_debug_info(options):
return shared.Settings.DEBUG_LEVEL >= 3 or shared.Settings.CYBERDWARF
return shared.Settings.DEBUG_LEVEL >= 3

with ToolchainProfiler.profile_block('parse arguments and setup'):
## Parse args
Expand Down Expand Up @@ -2015,13 +2015,6 @@ def include_and_export(name):
if options.js_opts:
shared.Settings.RUNNING_JS_OPTS = 1

if shared.Settings.CYBERDWARF:
shared.Settings.DEBUG_LEVEL = max(shared.Settings.DEBUG_LEVEL, 2)
shared.Settings.BUNDLED_CD_DEBUG_FILE = target + ".cd"
shared.Settings.SYSTEM_JS_LIBRARIES.append((0, shared.path_from_root('src', 'library_cyberdwarf.js')))
shared.Settings.SYSTEM_JS_LIBRARIES.append((0, shared.path_from_root('src', 'library_debugger_toolkit.js')))
newargs.append('-g')

if options.tracing:
cflags.append('-D__EMSCRIPTEN_TRACING__=1')
if shared.Settings.ALLOW_MEMORY_GROWTH:
Expand Down Expand Up @@ -2501,10 +2494,6 @@ def get_final():
if use_source_map(options):
shutil.move(wasm_temp + '.map', wasm_source_map_target)

if shared.Settings.CYBERDWARF:
cd_target = final + '.cd'
shutil.move(cd_target, shared.replace_or_append_suffix(target, '.cd'))

# exit block 'emscript'
log_time('emscript (llvm => executable code)')

Expand Down Expand Up @@ -2742,10 +2731,6 @@ def get_eliminate():
# src = re.sub(r'\n+[ \n]*\n+', '\n', src)
# open(final, 'w').write(src)

# Bundle symbol data in with the cyberdwarf file
if shared.Settings.CYBERDWARF:
run_process([shared.PYTHON, shared.path_from_root('tools', 'emdebug_cd_merger.py'), shared.replace_or_append_suffix(target, '.cd'), shared.replace_or_append_suffix(target, '.symbols')])

if use_source_map(options) and not shared.Settings.WASM:
emit_js_source_maps(target, optimizer.js_transform_tempfiles)

Expand Down Expand Up @@ -3165,7 +3150,6 @@ def do_binaryen(target, asm_target, options, memfile, wasm_binary_target,
# whether we need to emit -g in the intermediate binaryen invocations (but not necessarily at the very end).
# this is necessary for emitting a symbol map at the end.
intermediate_debug_info = bool(debug_info or options.emit_symbol_map or shared.Settings.ASYNCIFY_ONLY or shared.Settings.ASYNCIFY_REMOVE or shared.Settings.ASYNCIFY_ADD)
emit_symbol_map = options.emit_symbol_map or shared.Settings.CYBERDWARF
# finish compiling to WebAssembly, using asm2wasm, if we didn't already emit WebAssembly directly using the wasm backend.
if not shared.Settings.WASM_BACKEND:
if DEBUG:
Expand Down Expand Up @@ -3205,7 +3189,7 @@ def do_binaryen(target, asm_target, options, memfile, wasm_binary_target,
cmd += ['--enable-threads']
if intermediate_debug_info:
cmd += ['-g']
if emit_symbol_map:
if options.emit_symbol_map:
cmd += ['--symbolmap=' + shared.replace_or_append_suffix(target, '.symbols')]
# we prefer to emit a binary, as it is more efficient. however, when we
# want full debug info support (not just function names), then we must
Expand Down
18 changes: 0 additions & 18 deletions emscripten.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,6 @@ def finalize_output(outfile, post, function_table_data, bundled_args, metadata,
if DEBUG:
logger.debug(' emscript: python processing: finalize took %s seconds' % (time.time() - t))

write_cyberdwarf_data(outfile, metadata)


# Given JS code that consists only exactly of a series of "var a = ...;\n var b = ...;" statements,
# this function collapses the redundant 'var ' statements at the beginning of each line to a
Expand Down Expand Up @@ -545,16 +543,6 @@ def write_output_file(outfile, post, module):
outfile.write(post)


def write_cyberdwarf_data(outfile, metadata):
if not shared.Settings.CYBERDWARF:
return

assert('cyberdwarf_data' in metadata)
cd_file_name = outfile.name + ".cd"
with open(cd_file_name, 'w') as f:
json.dump({'cyberdwarf': metadata['cyberdwarf_data']}, f)


def create_backend_cmd(infile, temp_js):
"""Create asm.js backend command from settings dict"""
args = [
Expand Down Expand Up @@ -595,8 +583,6 @@ def create_backend_cmd(infile, temp_js):
args += ['-emscripten-wasm']
if building.is_wasm_only():
args += ['-emscripten-only-wasm']
if shared.Settings.CYBERDWARF:
args += ['-enable-cyberdwarf']
return args


Expand Down Expand Up @@ -655,10 +641,6 @@ def align_static_bump(metadata):
def update_settings_glue(metadata, DEBUG):
optimize_syscalls(metadata['declares'], DEBUG)

if shared.Settings.CYBERDWARF:
shared.Settings.DEFAULT_LIBRARY_FUNCS_TO_INCLUDE.append("cyberdwarf_Debugger")
shared.Settings.EXPORTED_FUNCTIONS.append("cyberdwarf_Debugger")

# Integrate info from backend
if shared.Settings.SIDE_MODULE:
# we don't need any JS library contents in side modules
Expand Down
4 changes: 0 additions & 4 deletions src/postamble.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ if (memoryInitializer) {
#endif
#endif // MEM_INIT_IN_WASM == 0

#if CYBERDWARF
Module['cyberdwarf'] = _cyberdwarf_Debugger(cyberDWARFFile);
#endif

var calledRun;

/**
Expand Down
4 changes: 0 additions & 4 deletions src/preamble.js
Original file line number Diff line number Diff line change
Expand Up @@ -784,10 +784,6 @@ Module['FS_createDataFile'] = FS.createDataFile;
Module['FS_createPreloadedFile'] = FS.createPreloadedFile;
#endif

#if CYBERDWARF
var cyberDWARFFile = '{{{ BUNDLED_CD_DEBUG_FILE }}}';
#endif

#include "URIUtils.js"

#if ASSERTIONS
Expand Down
8 changes: 0 additions & 8 deletions src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1467,14 +1467,6 @@ var ELIMINATE_DUPLICATE_FUNCTIONS_PASSES = 5;
// the ctors.
var EVAL_CTORS = 0;

// see http://kripken.github.io/emscripten-site/docs/debugging/CyberDWARF.html
// [fastcomp-only]
var CYBERDWARF = 0;

// Path to the CyberDWARF debug file passed to the compiler
// [fastcomp-only]
var BUNDLED_CD_DEBUG_FILE = "";

// Is enabled, use the JavaScript TextDecoder API for string marshalling.
// Enabled by default, set this to 0 to disable.
// If set to 2, we assume TextDecoder is present and usable, and do not emit
Expand Down
12 changes: 0 additions & 12 deletions tests/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -7123,18 +7123,6 @@ def test_function_eliminator_replace_variable_value_with_hash_info(self):
'test-function-eliminator-replace-variable-value-output.js',
use_hash_info=True)

@no_wasm_backend('uses CYBERDWARF')
def test_cyberdwarf_pointers(self):
self.run_process([EMCC, path_from_root('tests', 'debugger', 'test_pointers.cpp'), '-Oz', '-s', 'CYBERDWARF=1',
'--pre-js', path_from_root('tests', 'debugger', 'test_preamble.js'), '-o', 'test_pointers.js'])
self.run_js('test_pointers.js')

@no_wasm_backend('uses CYBERDWARF')
def test_cyberdwarf_union(self):
self.run_process([EMCC, path_from_root('tests', 'debugger', 'test_union.cpp'), '-Oz', '-s', 'CYBERDWARF=1',
'--pre-js', path_from_root('tests', 'debugger', 'test_preamble.js'), '-o', 'test_union.js'])
self.run_js('test_union.js')

def test_source_file_with_fixed_language_mode(self):
create_test_file('src_tmp_fixed_lang', '''
#include <string>
Expand Down
32 changes: 0 additions & 32 deletions tools/emdebug_cd_merger.py

This file was deleted.

3 changes: 0 additions & 3 deletions tools/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -1100,9 +1100,6 @@ def verify_settings():
# Requesting both Wasm and Wasm2JS support
Settings.WASM2JS = 1

if Settings.CYBERDWARF:
exit_with_error('emcc: CYBERDWARF is not supported by the LLVM wasm backend')


def print_compiler_stage(cmd):
"""Emulate the '-v' of clang/gcc by printing the name of the sub-command
Expand Down