@@ -10924,10 +10924,10 @@ def check_source_map_loc_info(address, loc):
10924
10924
stdout=PIPE).stdout
10925
10925
self.assertIn(loc, out)
10926
10926
10927
- # We test two locations within test_dwarf.cpp :
10928
- # out_to_js(0); // line 7
10929
- # __builtin_trap(); // line 14
10930
- self.run_process([EMCC, test_file('core/test_dwarf.cpp '),
10927
+ # We test two locations within test_dwarf.c :
10928
+ # out_to_js(0); // line 6
10929
+ # __builtin_trap(); // line 13
10930
+ self.run_process([EMCC, test_file('core/test_dwarf.c '),
10931
10931
'-g', '-gsource-map', '-O1', '-o', 'test_dwarf.js'])
10932
10932
# Address of out_to_js(0) within foo(), uninlined
10933
10933
out_to_js_call_addr = self.get_instr_addr('call\t0', 'test_dwarf.wasm')
@@ -10941,10 +10941,10 @@ def check_source_map_loc_info(address, loc):
10941
10941
unreachable_func = ['bar', 'main']
10942
10942
10943
10943
# Source location of out_to_js(0) within foo(), uninlined
10944
- out_to_js_call_loc = ['test_dwarf.cpp:7 :3']
10944
+ out_to_js_call_loc = ['test_dwarf.c:6 :3']
10945
10945
# Source locations of __builtin_trap() within bar(), inlined into main().
10946
10946
# The first one corresponds to the innermost inlined location.
10947
- unreachable_loc = ['test_dwarf.cpp:14 :3', 'test_dwarf.cpp:20 :3']
10947
+ unreachable_loc = ['test_dwarf.c:13 :3', 'test_dwarf.c:18 :3']
10948
10948
10949
10949
# 1. Test DWARF + source map together
10950
10950
# For DWARF, we check for the full inlined info for both function names and
@@ -10960,13 +10960,13 @@ def check_source_map_loc_info(address, loc):
10960
10960
# The addresses, function names, and source locations are the same across
10961
10961
# the builds because they are relative offsets from the code section, so we
10962
10962
# don't need to recompute them
10963
- self.run_process([EMCC, test_file('core/test_dwarf.cpp '),
10963
+ self.run_process([EMCC, test_file('core/test_dwarf.c '),
10964
10964
'-gsource-map', '-O1', '-o', 'test_dwarf.js'])
10965
10965
check_source_map_loc_info(out_to_js_call_addr, out_to_js_call_loc[0])
10966
10966
check_source_map_loc_info(unreachable_addr, unreachable_loc[0])
10967
10967
10968
10968
# 3. Test DWARF only
10969
- self.run_process([EMCC, test_file('core/test_dwarf.cpp '),
10969
+ self.run_process([EMCC, test_file('core/test_dwarf.c '),
10970
10970
'-g', '-O1', '-o', 'test_dwarf.js'])
10971
10971
check_dwarf_loc_info(out_to_js_call_addr, out_to_js_call_func,
10972
10972
out_to_js_call_loc)
@@ -10980,7 +10980,7 @@ def check_func_info(filename, address, func):
10980
10980
self.assertIn(func, out)
10981
10981
10982
10982
# 1. Test name section only
10983
- self.run_process([EMCC, test_file('core/test_dwarf.cpp '),
10983
+ self.run_process([EMCC, test_file('core/test_dwarf.c '),
10984
10984
'--profiling-funcs', '-O1', '-o', 'test_dwarf.js'])
10985
10985
with webassembly.Module('test_dwarf.wasm') as wasm:
10986
10986
self.assertTrue(wasm.has_name_section())
@@ -10989,12 +10989,12 @@ def check_func_info(filename, address, func):
10989
10989
out_to_js_call_addr = self.get_instr_addr('call\t0', 'test_dwarf.wasm')
10990
10990
# Address of __builtin_trap() within bar(), inlined into main()
10991
10991
unreachable_addr = self.get_instr_addr('unreachable', 'test_dwarf.wasm')
10992
- check_func_info('test_dwarf.wasm', out_to_js_call_addr, 'foo() ')
10992
+ check_func_info('test_dwarf.wasm', out_to_js_call_addr, 'foo')
10993
10993
# The name section will not show bar, as it's inlined into main
10994
10994
check_func_info('test_dwarf.wasm', unreachable_addr, '__original_main')
10995
10995
10996
10996
# 2. Test symbol map
10997
- self.run_process([EMCC, test_file('core/test_dwarf.cpp '),
10997
+ self.run_process([EMCC, test_file('core/test_dwarf.c '),
10998
10998
'-O1', '--emit-symbol-map', '-o', 'test_dwarf.js'])
10999
10999
self.assertExists('test_dwarf.js.symbols')
11000
11000
@@ -11007,7 +11007,7 @@ def check_symbolmap_info(address, func):
11007
11007
out_to_js_call_addr = self.get_instr_addr('call\t0', 'test_dwarf.wasm')
11008
11008
# Address of __builtin_trap() within bar(), inlined into main()
11009
11009
unreachable_addr = self.get_instr_addr('unreachable', 'test_dwarf.wasm')
11010
- check_symbolmap_info(out_to_js_call_addr, 'foo() ')
11010
+ check_symbolmap_info(out_to_js_call_addr, 'foo')
11011
11011
# The name section will not show bar, as it's inlined into main
11012
11012
check_symbolmap_info(unreachable_addr, '__original_main')
11013
11013
0 commit comments