summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-01-14 08:51:18 -0800
committerGitHub <noreply@github.com>2020-01-14 08:51:18 -0800
commita7be271b6371c5968b77b4227bd3159db558951f (patch)
tree8dfe4265f973e985c3c8097a0af38cae7dae2a18 /test
parent58d973cb15d2c1d53d16a5837a537ee0ebe50e27 (diff)
downloadbinaryen-a7be271b6371c5968b77b4227bd3159db558951f.tar.gz
binaryen-a7be271b6371c5968b77b4227bd3159db558951f.tar.bz2
binaryen-a7be271b6371c5968b77b4227bd3159db558951f.zip
Omit DWARF debug line ranges starting with 0 (#2587)
Check if an entry starts a new range of addresses. Each range is a set of related addresses, where in particular, if the first has been zeroed out by the linker, we must omit the entire range. If we do not, then the initial range is 0 and the others are offsets relative to it, which will look like random addresses, perhaps into the middle of instructions, and perhaps that happen to collide with real ones (a debugger would ignore those, so we must too; it's easier and better to simply omit them). See https://bugs.llvm.org/show_bug.cgi?id=44516#c2
Diffstat (limited to 'test')
-rw-r--r--test/passes/ignore_missing_func.bin.txt1067
-rw-r--r--test/passes/ignore_missing_func.passes1
-rw-r--r--test/passes/ignore_missing_func.wasmbin0 -> 1548 bytes
3 files changed, 1068 insertions, 0 deletions
diff --git a/test/passes/ignore_missing_func.bin.txt b/test/passes/ignore_missing_func.bin.txt
new file mode 100644
index 000000000..c64f22a0d
--- /dev/null
+++ b/test/passes/ignore_missing_func.bin.txt
@@ -0,0 +1,1067 @@
+(module
+ (type $none_=>_none (func))
+ (type $none_=>_i32 (func (result i32)))
+ (type $i32_=>_i32 (func (param i32) (result i32)))
+ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
+ (import "env" "memory" (memory $0 256 256))
+ (data (i32.const 1024) "\nvoid used(int x) {\n x++;\n x--;\n return x;\n}\n\nvoid unused(int x) {\n x >>= 1;\n x <<= 1;\n return x;\n}\n\nint main() {\n return used(42);\n}\n\00")
+ (data (i32.const 1168) "\00\04\00\00")
+ (import "env" "__indirect_function_table" (table $timport$1 1 funcref))
+ (global $global$0 (mut i32) (i32.const 5244064))
+ (global $global$1 i32 (i32.const 1172))
+ (export "__wasm_call_ctors" (func $__wasm_call_ctors))
+ (export "main" (func $main))
+ (export "__data_end" (global $global$1))
+ (func $__wasm_call_ctors (; 0 ;)
+ )
+ (func $used\28int\29 (; 1 ;) (param $0 i32) (result i32)
+ (local $1 i32)
+ (local $2 i32)
+ (local $3 i32)
+ (local $4 i32)
+ (local $5 i32)
+ (local $6 i32)
+ (local $7 i32)
+ (local $8 i32)
+ (local $9 i32)
+ (local $10 i32)
+ ;; code offset: 0xe
+ (local.set $1
+ ;; code offset: 0x8
+ (global.get $global$0)
+ )
+ ;; code offset: 0x12
+ (local.set $2
+ ;; code offset: 0x10
+ (i32.const 16)
+ )
+ ;; code offset: 0x19
+ (local.set $3
+ ;; code offset: 0x18
+ (i32.sub
+ ;; code offset: 0x14
+ (local.get $1)
+ ;; code offset: 0x16
+ (local.get $2)
+ )
+ )
+ ;; code offset: 0x1f
+ (i32.store offset=12
+ ;; code offset: 0x1b
+ (local.get $3)
+ ;; code offset: 0x1d
+ (local.get $0)
+ )
+ ;; code offset: 0x27
+ (local.set $4
+ ;; code offset: 0x24
+ (i32.load offset=12
+ ;; code offset: 0x22
+ (local.get $3)
+ )
+ )
+ ;; code offset: 0x2b
+ (local.set $5
+ ;; code offset: 0x29
+ (i32.const 1)
+ )
+ ;; code offset: 0x32
+ (local.set $6
+ ;; code offset: 0x31
+ (i32.add
+ ;; code offset: 0x2d
+ (local.get $4)
+ ;; code offset: 0x2f
+ (local.get $5)
+ )
+ )
+ ;; code offset: 0x38
+ (i32.store offset=12
+ ;; code offset: 0x34
+ (local.get $3)
+ ;; code offset: 0x36
+ (local.get $6)
+ )
+ ;; code offset: 0x40
+ (local.set $7
+ ;; code offset: 0x3d
+ (i32.load offset=12
+ ;; code offset: 0x3b
+ (local.get $3)
+ )
+ )
+ ;; code offset: 0x44
+ (local.set $8
+ ;; code offset: 0x42
+ (i32.const -1)
+ )
+ ;; code offset: 0x4b
+ (local.set $9
+ ;; code offset: 0x4a
+ (i32.add
+ ;; code offset: 0x46
+ (local.get $7)
+ ;; code offset: 0x48
+ (local.get $8)
+ )
+ )
+ ;; code offset: 0x51
+ (i32.store offset=12
+ ;; code offset: 0x4d
+ (local.get $3)
+ ;; code offset: 0x4f
+ (local.get $9)
+ )
+ ;; code offset: 0x59
+ (local.set $10
+ ;; code offset: 0x56
+ (i32.load offset=12
+ ;; code offset: 0x54
+ (local.get $3)
+ )
+ )
+ ;; code offset: 0x5d
+ (return
+ ;; code offset: 0x5b
+ (local.get $10)
+ )
+ )
+ (func $__original_main (; 2 ;) (result i32)
+ (local $0 i32)
+ (local $1 i32)
+ (local $2 i32)
+ (local $3 i32)
+ (local $4 i32)
+ (local $5 i32)
+ (local $6 i32)
+ (local $7 i32)
+ (local $8 i32)
+ (local $9 i32)
+ (local $10 i32)
+ ;; code offset: 0x69
+ (local.set $0
+ ;; code offset: 0x63
+ (global.get $global$0)
+ )
+ ;; code offset: 0x6d
+ (local.set $1
+ ;; code offset: 0x6b
+ (i32.const 16)
+ )
+ ;; code offset: 0x74
+ (local.set $2
+ ;; code offset: 0x73
+ (i32.sub
+ ;; code offset: 0x6f
+ (local.get $0)
+ ;; code offset: 0x71
+ (local.get $1)
+ )
+ )
+ ;; code offset: 0x78
+ (global.set $global$0
+ ;; code offset: 0x76
+ (local.get $2)
+ )
+ ;; code offset: 0x80
+ (local.set $3
+ ;; code offset: 0x7e
+ (i32.const 42)
+ )
+ ;; code offset: 0x84
+ (local.set $4
+ ;; code offset: 0x82
+ (i32.const 0)
+ )
+ ;; code offset: 0x8a
+ (i32.store offset=12
+ ;; code offset: 0x86
+ (local.get $2)
+ ;; code offset: 0x88
+ (local.get $4)
+ )
+ ;; code offset: 0x95
+ (local.set $5
+ ;; code offset: 0x8f
+ (call $used\28int\29
+ ;; code offset: 0x8d
+ (local.get $3)
+ )
+ )
+ ;; code offset: 0x99
+ (local.set $6
+ ;; code offset: 0x97
+ (i32.const 0)
+ )
+ ;; code offset: 0xa4
+ (local.set $7
+ ;; code offset: 0x9d
+ (i32.load offset=1168
+ ;; code offset: 0x9b
+ (local.get $6)
+ )
+ )
+ ;; code offset: 0xab
+ (local.set $8
+ ;; code offset: 0xaa
+ (i32.add
+ ;; code offset: 0xa6
+ (local.get $5)
+ ;; code offset: 0xa8
+ (local.get $7)
+ )
+ )
+ ;; code offset: 0xaf
+ (local.set $9
+ ;; code offset: 0xad
+ (i32.const 16)
+ )
+ ;; code offset: 0xb6
+ (local.set $10
+ ;; code offset: 0xb5
+ (i32.add
+ ;; code offset: 0xb1
+ (local.get $2)
+ ;; code offset: 0xb3
+ (local.get $9)
+ )
+ )
+ ;; code offset: 0xba
+ (global.set $global$0
+ ;; code offset: 0xb8
+ (local.get $10)
+ )
+ ;; code offset: 0xc2
+ (return
+ ;; code offset: 0xc0
+ (local.get $8)
+ )
+ )
+ (func $main (; 3 ;) (param $0 i32) (param $1 i32) (result i32)
+ (local $2 i32)
+ ;; code offset: 0xce
+ (local.set $2
+ ;; code offset: 0xc8
+ (call $__original_main)
+ )
+ ;; code offset: 0xd2
+ (return
+ ;; code offset: 0xd0
+ (local.get $2)
+ )
+ )
+ ;; custom section ".debug_info", size 175
+ ;; custom section ".debug_ranges", size 32
+ ;; custom section ".debug_abbrev", size 117
+ ;; custom section ".debug_line", size 128
+ ;; custom section ".debug_str", size 235
+ ;; custom section "producers", size 180
+)
+DWARF debug info
+================
+
+Contains section .debug_info (175 bytes)
+Contains section .debug_ranges (32 bytes)
+Contains section .debug_abbrev (117 bytes)
+Contains section .debug_line (128 bytes)
+Contains section .debug_str (235 bytes)
+
+.debug_abbrev contents:
+Abbrev table for offset: 0x00000000
+[1] DW_TAG_compile_unit DW_CHILDREN_yes
+ DW_AT_producer DW_FORM_strp
+ DW_AT_language DW_FORM_data2
+ DW_AT_name DW_FORM_strp
+ DW_AT_stmt_list DW_FORM_sec_offset
+ DW_AT_comp_dir DW_FORM_strp
+ DW_AT_low_pc DW_FORM_addr
+ DW_AT_ranges DW_FORM_sec_offset
+
+[2] DW_TAG_variable DW_CHILDREN_no
+ DW_AT_name DW_FORM_strp
+ DW_AT_type DW_FORM_ref4
+ DW_AT_external DW_FORM_flag_present
+ DW_AT_decl_file DW_FORM_data1
+ DW_AT_decl_line DW_FORM_data1
+ DW_AT_location DW_FORM_exprloc
+
+[3] DW_TAG_pointer_type DW_CHILDREN_no
+ DW_AT_type DW_FORM_ref4
+
+[4] DW_TAG_const_type DW_CHILDREN_no
+ DW_AT_type DW_FORM_ref4
+
+[5] DW_TAG_base_type DW_CHILDREN_no
+ DW_AT_name DW_FORM_strp
+ DW_AT_encoding DW_FORM_data1
+ DW_AT_byte_size DW_FORM_data1
+
+[6] DW_TAG_subprogram DW_CHILDREN_yes
+ DW_AT_low_pc DW_FORM_addr
+ DW_AT_high_pc DW_FORM_data4
+ DW_AT_linkage_name DW_FORM_strp
+ DW_AT_name DW_FORM_strp
+ DW_AT_decl_file DW_FORM_data1
+ DW_AT_decl_line DW_FORM_data1
+ DW_AT_type DW_FORM_ref4
+ DW_AT_external DW_FORM_flag_present
+
+[7] DW_TAG_formal_parameter DW_CHILDREN_no
+ DW_AT_location DW_FORM_exprloc
+ DW_AT_name DW_FORM_strp
+ DW_AT_decl_file DW_FORM_data1
+ DW_AT_decl_line DW_FORM_data1
+ DW_AT_type DW_FORM_ref4
+
+[8] DW_TAG_subprogram DW_CHILDREN_no
+ DW_AT_low_pc DW_FORM_addr
+ DW_AT_high_pc DW_FORM_data4
+ DW_AT_name DW_FORM_strp
+ DW_AT_decl_file DW_FORM_data1
+ DW_AT_decl_line DW_FORM_data1
+ DW_AT_type DW_FORM_ref4
+ DW_AT_external DW_FORM_flag_present
+
+
+.debug_info contents:
+0x00000000: Compile Unit: length = 0x000000ab version = 0x0004 abbr_offset = 0x0000 addr_size = 0x04 (next unit at 0x000000af)
+
+0x0000000b: DW_TAG_compile_unit [1] *
+ DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000000] = "clang version 10.0.0 (/b/s/w/ir/cache/git/chromium.googlesource.com-external-github.com-llvm-llvm--project f39277c1d370ccbbec2e20a20375ee6fb7281ae4)")
+ DW_AT_language [DW_FORM_data2] (DW_LANG_C_plus_plus)
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000095] = "a.cpp")
+ DW_AT_stmt_list [DW_FORM_sec_offset] (0x00000000)
+ DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x0000009b] = "/home/alon/Dev/emscripten")
+ DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
+ DW_AT_ranges [DW_FORM_sec_offset] (0x00000000
+ [0x00000005, 0x0000005f))
+
+0x00000026: DW_TAG_variable [2]
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000b5] = "quine")
+ DW_AT_type [DW_FORM_ref4] (cu + 0x0037 => {0x00000037} "const char*")
+ DW_AT_external [DW_FORM_flag_present] (true)
+ DW_AT_decl_file [DW_FORM_data1] ("/home/alon/Dev/emscripten/a.cpp")
+ DW_AT_decl_line [DW_FORM_data1] (2)
+ DW_AT_location [DW_FORM_exprloc] (DW_OP_addr 0x490)
+
+0x00000037: DW_TAG_pointer_type [3]
+ DW_AT_type [DW_FORM_ref4] (cu + 0x003c => {0x0000003c} "const char")
+
+0x0000003c: DW_TAG_const_type [4]
+ DW_AT_type [DW_FORM_ref4] (cu + 0x0041 => {0x00000041} "char")
+
+0x00000041: DW_TAG_base_type [5]
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000bb] = "char")
+ DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed_char)
+ DW_AT_byte_size [DW_FORM_data1] (0x01)
+
+0x00000048: DW_TAG_base_type [5]
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000c0] = "int")
+ DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed)
+ DW_AT_byte_size [DW_FORM_data1] (0x04)
+
+0x0000004f: DW_TAG_subprogram [6] *
+ DW_AT_low_pc [DW_FORM_addr] (0x0000000000000005)
+ DW_AT_high_pc [DW_FORM_data4] (0x0000005a)
+ DW_AT_linkage_name [DW_FORM_strp] ( .debug_str[0x000000c4] = "_Z4usedi")
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000cd] = "used")
+ DW_AT_decl_file [DW_FORM_data1] ("/home/alon/Dev/emscripten/a.cpp")
+ DW_AT_decl_line [DW_FORM_data1] (4)
+ DW_AT_type [DW_FORM_ref4] (cu + 0x0048 => {0x00000048} "int")
+ DW_AT_external [DW_FORM_flag_present] (true)
+
+0x00000066: DW_TAG_formal_parameter [7]
+ DW_AT_location [DW_FORM_exprloc] (DW_OP_plus_uconst 0xc)
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000e9] = "x")
+ DW_AT_decl_file [DW_FORM_data1] ("/home/alon/Dev/emscripten/a.cpp")
+ DW_AT_decl_line [DW_FORM_data1] (4)
+ DW_AT_type [DW_FORM_ref4] (cu + 0x0048 => {0x00000048} "int")
+
+0x00000074: NULL
+
+0x00000075: DW_TAG_subprogram [6] *
+ DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
+ DW_AT_high_pc [DW_FORM_data4] (0x0000005a)
+ DW_AT_linkage_name [DW_FORM_strp] ( .debug_str[0x000000d2] = "_Z6unusedi")
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000dd] = "unused")
+ DW_AT_decl_file [DW_FORM_data1] ("/home/alon/Dev/emscripten/a.cpp")
+ DW_AT_decl_line [DW_FORM_data1] (10)
+ DW_AT_type [DW_FORM_ref4] (cu + 0x0048 => {0x00000048} "int")
+ DW_AT_external [DW_FORM_flag_present] (true)
+
+0x0000008c: DW_TAG_formal_parameter [7]
+ DW_AT_location [DW_FORM_exprloc] (DW_OP_plus_uconst 0xc)
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000e9] = "x")
+ DW_AT_decl_file [DW_FORM_data1] ("/home/alon/Dev/emscripten/a.cpp")
+ DW_AT_decl_line [DW_FORM_data1] (10)
+ DW_AT_type [DW_FORM_ref4] (cu + 0x0048 => {0x00000048} "int")
+
+0x0000009a: NULL
+
+0x0000009b: DW_TAG_subprogram [8]
+ DW_AT_low_pc [DW_FORM_addr] (0x0000000000000060)
+ DW_AT_high_pc [DW_FORM_data4] (0x00000064)
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000e4] = "main")
+ DW_AT_decl_file [DW_FORM_data1] ("/home/alon/Dev/emscripten/a.cpp")
+ DW_AT_decl_line [DW_FORM_data1] (16)
+ DW_AT_type [DW_FORM_ref4] (cu + 0x0048 => {0x00000048} "int")
+ DW_AT_external [DW_FORM_flag_present] (true)
+
+0x000000ae: NULL
+
+.debug_line contents:
+debug_line[0x00000000]
+Line table prologue:
+ total_length: 0x0000007c
+ version: 4
+ prologue_length: 0x0000001d
+ min_inst_length: 1
+max_ops_per_inst: 1
+ default_is_stmt: 1
+ line_base: -5
+ line_range: 14
+ opcode_base: 13
+standard_opcode_lengths[DW_LNS_copy] = 0
+standard_opcode_lengths[DW_LNS_advance_pc] = 1
+standard_opcode_lengths[DW_LNS_advance_line] = 1
+standard_opcode_lengths[DW_LNS_set_file] = 1
+standard_opcode_lengths[DW_LNS_set_column] = 1
+standard_opcode_lengths[DW_LNS_negate_stmt] = 0
+standard_opcode_lengths[DW_LNS_set_basic_block] = 0
+standard_opcode_lengths[DW_LNS_const_add_pc] = 0
+standard_opcode_lengths[DW_LNS_fixed_advance_pc] = 1
+standard_opcode_lengths[DW_LNS_set_prologue_end] = 0
+standard_opcode_lengths[DW_LNS_set_epilogue_begin] = 0
+standard_opcode_lengths[DW_LNS_set_isa] = 1
+file_names[ 1]:
+ name: "a.cpp"
+ dir_index: 0
+ mod_time: 0x00000000
+ length: 0x00000000
+0x00000027: 00 DW_LNE_set_address (0x0000000000000005)
+0x0000002e: 15 address += 0, line += 3
+ 0x0000000000000005 4 0 1 0 0 is_stmt
+
+0x0000002f: 05 DW_LNS_set_column (4)
+0x00000031: 0a DW_LNS_set_prologue_end
+0x00000032: 08 DW_LNS_const_add_pc (0x0000000000000011)
+0x00000033: bb address += 12, line += 1
+ 0x0000000000000022 5 4 1 0 0 is_stmt prologue_end
+
+0x00000034: 08 DW_LNS_const_add_pc (0x0000000000000011)
+0x00000035: 83 address += 8, line += 1
+ 0x000000000000003b 6 4 1 0 0 is_stmt
+
+0x00000036: 05 DW_LNS_set_column (10)
+0x00000038: 08 DW_LNS_const_add_pc (0x0000000000000011)
+0x00000039: 83 address += 8, line += 1
+ 0x0000000000000054 7 10 1 0 0 is_stmt
+
+0x0000003a: 05 DW_LNS_set_column (3)
+0x0000003c: 06 DW_LNS_negate_stmt
+0x0000003d: 74 address += 7, line += 0
+ 0x000000000000005b 7 3 1 0 0
+
+0x0000003e: 02 DW_LNS_advance_pc (4)
+0x00000040: 00 DW_LNE_end_sequence
+ 0x000000000000005f 7 3 1 0 0 end_sequence
+
+0x00000043: 00 DW_LNE_set_address (0x0000000000000000)
+0x0000004a: 03 DW_LNS_advance_line (10)
+0x0000004c: 01 DW_LNS_copy
+ 0x0000000000000000 10 0 1 0 0 is_stmt
+
+
+0x0000004d: 05 DW_LNS_set_column (5)
+0x0000004f: 0a DW_LNS_set_prologue_end
+0x00000050: 08 DW_LNS_const_add_pc (0x0000000000000011)
+0x00000051: bb address += 12, line += 1
+ 0x000000000000001d 11 5 1 0 0 is_stmt prologue_end
+
+0x00000052: 08 DW_LNS_const_add_pc (0x0000000000000011)
+0x00000053: 83 address += 8, line += 1
+ 0x0000000000000036 12 5 1 0 0 is_stmt
+
+0x00000054: 05 DW_LNS_set_column (10)
+0x00000056: 08 DW_LNS_const_add_pc (0x0000000000000011)
+0x00000057: 83 address += 8, line += 1
+ 0x000000000000004f 13 10 1 0 0 is_stmt
+
+0x00000058: 05 DW_LNS_set_column (3)
+0x0000005a: 06 DW_LNS_negate_stmt
+0x0000005b: 74 address += 7, line += 0
+ 0x0000000000000056 13 3 1 0 0
+
+0x0000005c: 02 DW_LNS_advance_pc (4)
+0x0000005e: 00 DW_LNE_end_sequence
+ 0x000000000000005a 13 3 1 0 0 end_sequence
+
+0x00000061: 00 DW_LNE_set_address (0x0000000000000060)
+0x00000068: 03 DW_LNS_advance_line (16)
+0x0000006a: 01 DW_LNS_copy
+ 0x0000000000000060 16 0 1 0 0 is_stmt
+
+
+0x0000006b: 05 DW_LNS_set_column (10)
+0x0000006d: 0a DW_LNS_set_prologue_end
+0x0000006e: 02 DW_LNS_advance_pc (45)
+0x00000070: 13 address += 0, line += 1
+ 0x000000000000008d 17 10 1 0 0 is_stmt prologue_end
+
+0x00000071: 05 DW_LNS_set_column (25)
+0x00000073: 06 DW_LNS_negate_stmt
+0x00000074: 9e address += 10, line += 0
+ 0x0000000000000097 17 25 1 0 0
+
+0x00000075: 05 DW_LNS_set_column (19)
+0x00000077: e4 address += 15, line += 0
+ 0x00000000000000a6 17 19 1 0 0
+
+0x00000078: 05 DW_LNS_set_column (3)
+0x0000007a: 74 address += 7, line += 0
+ 0x00000000000000ad 17 3 1 0 0
+
+0x0000007b: 02 DW_LNS_advance_pc (23)
+0x0000007d: 00 DW_LNE_end_sequence
+ 0x00000000000000c4 17 3 1 0 0 end_sequence
+
+
+.debug_str contents:
+0x00000000: "clang version 10.0.0 (/b/s/w/ir/cache/git/chromium.googlesource.com-external-github.com-llvm-llvm--project f39277c1d370ccbbec2e20a20375ee6fb7281ae4)"
+0x00000095: "a.cpp"
+0x0000009b: "/home/alon/Dev/emscripten"
+0x000000b5: "quine"
+0x000000bb: "char"
+0x000000c0: "int"
+0x000000c4: "_Z4usedi"
+0x000000cd: "used"
+0x000000d2: "_Z6unusedi"
+0x000000dd: "unused"
+0x000000e4: "main"
+0x000000e9: "x"
+
+.debug_ranges contents:
+00000000 00000005 0000005f
+00000000 <End of list>
+00000010 00000060 000000c4
+00000010 <End of list>
+DWARF debug info
+================
+
+Contains section .debug_info (175 bytes)
+Contains section .debug_ranges (32 bytes)
+Contains section .debug_abbrev (117 bytes)
+Contains section .debug_line (163 bytes)
+Contains section .debug_str (235 bytes)
+
+.debug_abbrev contents:
+Abbrev table for offset: 0x00000000
+[1] DW_TAG_compile_unit DW_CHILDREN_yes
+ DW_AT_producer DW_FORM_strp
+ DW_AT_language DW_FORM_data2
+ DW_AT_name DW_FORM_strp
+ DW_AT_stmt_list DW_FORM_sec_offset
+ DW_AT_comp_dir DW_FORM_strp
+ DW_AT_low_pc DW_FORM_addr
+ DW_AT_ranges DW_FORM_sec_offset
+
+[2] DW_TAG_variable DW_CHILDREN_no
+ DW_AT_name DW_FORM_strp
+ DW_AT_type DW_FORM_ref4
+ DW_AT_external DW_FORM_flag_present
+ DW_AT_decl_file DW_FORM_data1
+ DW_AT_decl_line DW_FORM_data1
+ DW_AT_location DW_FORM_exprloc
+
+[3] DW_TAG_pointer_type DW_CHILDREN_no
+ DW_AT_type DW_FORM_ref4
+
+[4] DW_TAG_const_type DW_CHILDREN_no
+ DW_AT_type DW_FORM_ref4
+
+[5] DW_TAG_base_type DW_CHILDREN_no
+ DW_AT_name DW_FORM_strp
+ DW_AT_encoding DW_FORM_data1
+ DW_AT_byte_size DW_FORM_data1
+
+[6] DW_TAG_subprogram DW_CHILDREN_yes
+ DW_AT_low_pc DW_FORM_addr
+ DW_AT_high_pc DW_FORM_data4
+ DW_AT_linkage_name DW_FORM_strp
+ DW_AT_name DW_FORM_strp
+ DW_AT_decl_file DW_FORM_data1
+ DW_AT_decl_line DW_FORM_data1
+ DW_AT_type DW_FORM_ref4
+ DW_AT_external DW_FORM_flag_present
+
+[7] DW_TAG_formal_parameter DW_CHILDREN_no
+ DW_AT_location DW_FORM_exprloc
+ DW_AT_name DW_FORM_strp
+ DW_AT_decl_file DW_FORM_data1
+ DW_AT_decl_line DW_FORM_data1
+ DW_AT_type DW_FORM_ref4
+
+[8] DW_TAG_subprogram DW_CHILDREN_no
+ DW_AT_low_pc DW_FORM_addr
+ DW_AT_high_pc DW_FORM_data4
+ DW_AT_name DW_FORM_strp
+ DW_AT_decl_file DW_FORM_data1
+ DW_AT_decl_line DW_FORM_data1
+ DW_AT_type DW_FORM_ref4
+ DW_AT_external DW_FORM_flag_present
+
+
+.debug_info contents:
+0x00000000: Compile Unit: length = 0x000000ab version = 0x0004 abbr_offset = 0x0000 addr_size = 0x04 (next unit at 0x000000af)
+
+0x0000000b: DW_TAG_compile_unit [1] *
+ DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000000] = "clang version 10.0.0 (/b/s/w/ir/cache/git/chromium.googlesource.com-external-github.com-llvm-llvm--project f39277c1d370ccbbec2e20a20375ee6fb7281ae4)")
+ DW_AT_language [DW_FORM_data2] (DW_LANG_C_plus_plus)
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000095] = "a.cpp")
+ DW_AT_stmt_list [DW_FORM_sec_offset] (0x00000000)
+ DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x0000009b] = "/home/alon/Dev/emscripten")
+ DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
+ DW_AT_ranges [DW_FORM_sec_offset] (0x00000000
+ [0x00000005, 0x0000005f))
+
+0x00000026: DW_TAG_variable [2]
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000b5] = "quine")
+ DW_AT_type [DW_FORM_ref4] (cu + 0x0037 => {0x00000037} "const char*")
+ DW_AT_external [DW_FORM_flag_present] (true)
+ DW_AT_decl_file [DW_FORM_data1] ("/home/alon/Dev/emscripten/a.cpp")
+ DW_AT_decl_line [DW_FORM_data1] (2)
+ DW_AT_location [DW_FORM_exprloc] (DW_OP_addr 0x490)
+
+0x00000037: DW_TAG_pointer_type [3]
+ DW_AT_type [DW_FORM_ref4] (cu + 0x003c => {0x0000003c} "const char")
+
+0x0000003c: DW_TAG_const_type [4]
+ DW_AT_type [DW_FORM_ref4] (cu + 0x0041 => {0x00000041} "char")
+
+0x00000041: DW_TAG_base_type [5]
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000bb] = "char")
+ DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed_char)
+ DW_AT_byte_size [DW_FORM_data1] (0x01)
+
+0x00000048: DW_TAG_base_type [5]
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000c0] = "int")
+ DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed)
+ DW_AT_byte_size [DW_FORM_data1] (0x04)
+
+0x0000004f: DW_TAG_subprogram [6] *
+ DW_AT_low_pc [DW_FORM_addr] (0x0000000000000005)
+ DW_AT_high_pc [DW_FORM_data4] (0x0000005a)
+ DW_AT_linkage_name [DW_FORM_strp] ( .debug_str[0x000000c4] = "_Z4usedi")
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000cd] = "used")
+ DW_AT_decl_file [DW_FORM_data1] ("/home/alon/Dev/emscripten/a.cpp")
+ DW_AT_decl_line [DW_FORM_data1] (4)
+ DW_AT_type [DW_FORM_ref4] (cu + 0x0048 => {0x00000048} "int")
+ DW_AT_external [DW_FORM_flag_present] (true)
+
+0x00000066: DW_TAG_formal_parameter [7]
+ DW_AT_location [DW_FORM_exprloc] (DW_OP_plus_uconst 0xc)
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000e9] = "x")
+ DW_AT_decl_file [DW_FORM_data1] ("/home/alon/Dev/emscripten/a.cpp")
+ DW_AT_decl_line [DW_FORM_data1] (4)
+ DW_AT_type [DW_FORM_ref4] (cu + 0x0048 => {0x00000048} "int")
+
+0x00000074: NULL
+
+0x00000075: DW_TAG_subprogram [6] *
+ DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
+ DW_AT_high_pc [DW_FORM_data4] (0x0000005a)
+ DW_AT_linkage_name [DW_FORM_strp] ( .debug_str[0x000000d2] = "_Z6unusedi")
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000dd] = "unused")
+ DW_AT_decl_file [DW_FORM_data1] ("/home/alon/Dev/emscripten/a.cpp")
+ DW_AT_decl_line [DW_FORM_data1] (10)
+ DW_AT_type [DW_FORM_ref4] (cu + 0x0048 => {0x00000048} "int")
+ DW_AT_external [DW_FORM_flag_present] (true)
+
+0x0000008c: DW_TAG_formal_parameter [7]
+ DW_AT_location [DW_FORM_exprloc] (DW_OP_plus_uconst 0xc)
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000e9] = "x")
+ DW_AT_decl_file [DW_FORM_data1] ("/home/alon/Dev/emscripten/a.cpp")
+ DW_AT_decl_line [DW_FORM_data1] (10)
+ DW_AT_type [DW_FORM_ref4] (cu + 0x0048 => {0x00000048} "int")
+
+0x0000009a: NULL
+
+0x0000009b: DW_TAG_subprogram [8]
+ DW_AT_low_pc [DW_FORM_addr] (0x0000000000000060)
+ DW_AT_high_pc [DW_FORM_data4] (0x00000064)
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000e4] = "main")
+ DW_AT_decl_file [DW_FORM_data1] ("/home/alon/Dev/emscripten/a.cpp")
+ DW_AT_decl_line [DW_FORM_data1] (16)
+ DW_AT_type [DW_FORM_ref4] (cu + 0x0048 => {0x00000048} "int")
+ DW_AT_external [DW_FORM_flag_present] (true)
+
+0x000000ae: NULL
+
+.debug_line contents:
+debug_line[0x00000000]
+Line table prologue:
+ total_length: 0x0000009f
+ version: 4
+ prologue_length: 0x0000001d
+ min_inst_length: 1
+max_ops_per_inst: 1
+ default_is_stmt: 1
+ line_base: -5
+ line_range: 14
+ opcode_base: 13
+standard_opcode_lengths[DW_LNS_copy] = 0
+standard_opcode_lengths[DW_LNS_advance_pc] = 1
+standard_opcode_lengths[DW_LNS_advance_line] = 1
+standard_opcode_lengths[DW_LNS_set_file] = 1
+standard_opcode_lengths[DW_LNS_set_column] = 1
+standard_opcode_lengths[DW_LNS_negate_stmt] = 0
+standard_opcode_lengths[DW_LNS_set_basic_block] = 0
+standard_opcode_lengths[DW_LNS_const_add_pc] = 0
+standard_opcode_lengths[DW_LNS_fixed_advance_pc] = 1
+standard_opcode_lengths[DW_LNS_set_prologue_end] = 0
+standard_opcode_lengths[DW_LNS_set_epilogue_begin] = 0
+standard_opcode_lengths[DW_LNS_set_isa] = 1
+file_names[ 1]:
+ name: "a.cpp"
+ dir_index: 0
+ mod_time: 0x00000000
+ length: 0x00000000
+0x00000027: 00 DW_LNE_set_address (0x000000000000001e)
+0x0000002e: 03 DW_LNS_advance_line (5)
+0x00000030: 05 DW_LNS_set_column (4)
+0x00000032: 0a DW_LNS_set_prologue_end
+0x00000033: 00 DW_LNE_end_sequence
+ 0x000000000000001e 5 4 1 0 0 is_stmt end_sequence
+
+0x00000036: 00 DW_LNE_set_address (0x0000000000000037)
+0x0000003d: 03 DW_LNS_advance_line (6)
+0x0000003f: 05 DW_LNS_set_column (4)
+0x00000041: 0a DW_LNS_set_prologue_end
+0x00000042: 00 DW_LNE_end_sequence
+ 0x0000000000000037 6 4 1 0 0 is_stmt end_sequence
+
+0x00000045: 00 DW_LNE_set_address (0x0000000000000050)
+0x0000004c: 03 DW_LNS_advance_line (7)
+0x0000004e: 05 DW_LNS_set_column (10)
+0x00000050: 0a DW_LNS_set_prologue_end
+0x00000051: 00 DW_LNE_end_sequence
+ 0x0000000000000050 7 10 1 0 0 is_stmt end_sequence
+
+0x00000054: 00 DW_LNE_set_address (0x0000000000000057)
+0x0000005b: 03 DW_LNS_advance_line (7)
+0x0000005d: 05 DW_LNS_set_column (3)
+0x0000005f: 06 DW_LNS_negate_stmt
+0x00000060: 0a DW_LNS_set_prologue_end
+0x00000061: 00 DW_LNE_end_sequence
+ 0x0000000000000057 7 3 1 0 0 end_sequence
+
+0x00000064: 00 DW_LNE_set_address (0x0000000000000081)
+0x0000006b: 03 DW_LNS_advance_line (17)
+0x0000006d: 05 DW_LNS_set_column (10)
+0x0000006f: 0a DW_LNS_set_prologue_end
+0x00000070: 00 DW_LNE_end_sequence
+ 0x0000000000000081 17 10 1 0 0 is_stmt end_sequence
+
+0x00000073: 00 DW_LNE_set_address (0x0000000000000087)
+0x0000007a: 03 DW_LNS_advance_line (17)
+0x0000007c: 05 DW_LNS_set_column (25)
+0x0000007e: 06 DW_LNS_negate_stmt
+0x0000007f: 0a DW_LNS_set_prologue_end
+0x00000080: 00 DW_LNE_end_sequence
+ 0x0000000000000087 17 25 1 0 0 end_sequence
+
+0x00000083: 00 DW_LNE_set_address (0x0000000000000093)
+0x0000008a: 03 DW_LNS_advance_line (17)
+0x0000008c: 05 DW_LNS_set_column (19)
+0x0000008e: 06 DW_LNS_negate_stmt
+0x0000008f: 0a DW_LNS_set_prologue_end
+0x00000090: 00 DW_LNE_end_sequence
+ 0x0000000000000093 17 19 1 0 0 end_sequence
+
+0x00000093: 00 DW_LNE_set_address (0x000000000000009a)
+0x0000009a: 03 DW_LNS_advance_line (17)
+0x0000009c: 05 DW_LNS_set_column (3)
+0x0000009e: 06 DW_LNS_negate_stmt
+0x0000009f: 0a DW_LNS_set_prologue_end
+0x000000a0: 00 DW_LNE_end_sequence
+ 0x000000000000009a 17 3 1 0 0 end_sequence
+
+
+.debug_str contents:
+0x00000000: "clang version 10.0.0 (/b/s/w/ir/cache/git/chromium.googlesource.com-external-github.com-llvm-llvm--project f39277c1d370ccbbec2e20a20375ee6fb7281ae4)"
+0x00000095: "a.cpp"
+0x0000009b: "/home/alon/Dev/emscripten"
+0x000000b5: "quine"
+0x000000bb: "char"
+0x000000c0: "int"
+0x000000c4: "_Z4usedi"
+0x000000cd: "used"
+0x000000d2: "_Z6unusedi"
+0x000000dd: "unused"
+0x000000e4: "main"
+0x000000e9: "x"
+
+.debug_ranges contents:
+00000000 00000005 0000005f
+00000000 <End of list>
+00000010 00000060 000000c4
+00000010 <End of list>
+(module
+ (type $none_=>_none (func))
+ (type $none_=>_i32 (func (result i32)))
+ (type $i32_=>_i32 (func (param i32) (result i32)))
+ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
+ (import "env" "memory" (memory $0 256 256))
+ (data (i32.const 1024) "\nvoid used(int x) {\n x++;\n x--;\n return x;\n}\n\nvoid unused(int x) {\n x >>= 1;\n x <<= 1;\n return x;\n}\n\nint main() {\n return used(42);\n}\n\00")
+ (data (i32.const 1168) "\00\04\00\00")
+ (import "env" "__indirect_function_table" (table $timport$1 1 funcref))
+ (global $global$0 (mut i32) (i32.const 5244064))
+ (global $global$1 i32 (i32.const 1172))
+ (export "__wasm_call_ctors" (func $__wasm_call_ctors))
+ (export "main" (func $main))
+ (export "__data_end" (global $global$1))
+ (func $__wasm_call_ctors (; 0 ;)
+ )
+ (func $used\28int\29 (; 1 ;) (param $0 i32) (result i32)
+ (local $1 i32)
+ (local $2 i32)
+ (local $3 i32)
+ (local $4 i32)
+ (local $5 i32)
+ (local $6 i32)
+ (local $7 i32)
+ (local $8 i32)
+ (local $9 i32)
+ (local $10 i32)
+ ;; code offset: 0xa
+ (local.set $1
+ ;; code offset: 0x8
+ (global.get $global$0)
+ )
+ ;; code offset: 0xe
+ (local.set $2
+ ;; code offset: 0xc
+ (i32.const 16)
+ )
+ ;; code offset: 0x15
+ (local.set $3
+ ;; code offset: 0x14
+ (i32.sub
+ ;; code offset: 0x10
+ (local.get $1)
+ ;; code offset: 0x12
+ (local.get $2)
+ )
+ )
+ ;; code offset: 0x1b
+ (i32.store offset=12
+ ;; code offset: 0x17
+ (local.get $3)
+ ;; code offset: 0x19
+ (local.get $0)
+ )
+ ;; code offset: 0x23
+ (local.set $4
+ ;; code offset: 0x20
+ (i32.load offset=12
+ ;; code offset: 0x1e
+ (local.get $3)
+ )
+ )
+ ;; code offset: 0x27
+ (local.set $5
+ ;; code offset: 0x25
+ (i32.const 1)
+ )
+ ;; code offset: 0x2e
+ (local.set $6
+ ;; code offset: 0x2d
+ (i32.add
+ ;; code offset: 0x29
+ (local.get $4)
+ ;; code offset: 0x2b
+ (local.get $5)
+ )
+ )
+ ;; code offset: 0x34
+ (i32.store offset=12
+ ;; code offset: 0x30
+ (local.get $3)
+ ;; code offset: 0x32
+ (local.get $6)
+ )
+ ;; code offset: 0x3c
+ (local.set $7
+ ;; code offset: 0x39
+ (i32.load offset=12
+ ;; code offset: 0x37
+ (local.get $3)
+ )
+ )
+ ;; code offset: 0x40
+ (local.set $8
+ ;; code offset: 0x3e
+ (i32.const -1)
+ )
+ ;; code offset: 0x47
+ (local.set $9
+ ;; code offset: 0x46
+ (i32.add
+ ;; code offset: 0x42
+ (local.get $7)
+ ;; code offset: 0x44
+ (local.get $8)
+ )
+ )
+ ;; code offset: 0x4d
+ (i32.store offset=12
+ ;; code offset: 0x49
+ (local.get $3)
+ ;; code offset: 0x4b
+ (local.get $9)
+ )
+ ;; code offset: 0x55
+ (local.set $10
+ ;; code offset: 0x52
+ (i32.load offset=12
+ ;; code offset: 0x50
+ (local.get $3)
+ )
+ )
+ ;; code offset: 0x59
+ (return
+ ;; code offset: 0x57
+ (local.get $10)
+ )
+ )
+ (func $__original_main (; 2 ;) (result i32)
+ (local $0 i32)
+ (local $1 i32)
+ (local $2 i32)
+ (local $3 i32)
+ (local $4 i32)
+ (local $5 i32)
+ (local $6 i32)
+ (local $7 i32)
+ (local $8 i32)
+ (local $9 i32)
+ (local $10 i32)
+ ;; code offset: 0x61
+ (local.set $0
+ ;; code offset: 0x5f
+ (global.get $global$0)
+ )
+ ;; code offset: 0x65
+ (local.set $1
+ ;; code offset: 0x63
+ (i32.const 16)
+ )
+ ;; code offset: 0x6c
+ (local.set $2
+ ;; code offset: 0x6b
+ (i32.sub
+ ;; code offset: 0x67
+ (local.get $0)
+ ;; code offset: 0x69
+ (local.get $1)
+ )
+ )
+ ;; code offset: 0x70
+ (global.set $global$0
+ ;; code offset: 0x6e
+ (local.get $2)
+ )
+ ;; code offset: 0x74
+ (local.set $3
+ ;; code offset: 0x72
+ (i32.const 42)
+ )
+ ;; code offset: 0x78
+ (local.set $4
+ ;; code offset: 0x76
+ (i32.const 0)
+ )
+ ;; code offset: 0x7e
+ (i32.store offset=12
+ ;; code offset: 0x7a
+ (local.get $2)
+ ;; code offset: 0x7c
+ (local.get $4)
+ )
+ ;; code offset: 0x85
+ (local.set $5
+ ;; code offset: 0x83
+ (call $used\28int\29
+ ;; code offset: 0x81
+ (local.get $3)
+ )
+ )
+ ;; code offset: 0x89
+ (local.set $6
+ ;; code offset: 0x87
+ (i32.const 0)
+ )
+ ;; code offset: 0x91
+ (local.set $7
+ ;; code offset: 0x8d
+ (i32.load offset=1168
+ ;; code offset: 0x8b
+ (local.get $6)
+ )
+ )
+ ;; code offset: 0x98
+ (local.set $8
+ ;; code offset: 0x97
+ (i32.add
+ ;; code offset: 0x93
+ (local.get $5)
+ ;; code offset: 0x95
+ (local.get $7)
+ )
+ )
+ ;; code offset: 0x9c
+ (local.set $9
+ ;; code offset: 0x9a
+ (i32.const 16)
+ )
+ ;; code offset: 0xa3
+ (local.set $10
+ ;; code offset: 0xa2
+ (i32.add
+ ;; code offset: 0x9e
+ (local.get $2)
+ ;; code offset: 0xa0
+ (local.get $9)
+ )
+ )
+ ;; code offset: 0xa7
+ (global.set $global$0
+ ;; code offset: 0xa5
+ (local.get $10)
+ )
+ ;; code offset: 0xab
+ (return
+ ;; code offset: 0xa9
+ (local.get $8)
+ )
+ )
+ (func $main (; 3 ;) (param $0 i32) (param $1 i32) (result i32)
+ (local $2 i32)
+ ;; code offset: 0xb3
+ (local.set $2
+ ;; code offset: 0xb1
+ (call $__original_main)
+ )
+ ;; code offset: 0xb7
+ (return
+ ;; code offset: 0xb5
+ (local.get $2)
+ )
+ )
+ ;; custom section ".debug_info", size 175
+ ;; custom section ".debug_ranges", size 32
+ ;; custom section ".debug_abbrev", size 117
+ ;; custom section ".debug_line", size 163
+ ;; custom section ".debug_str", size 235
+ ;; custom section "producers", size 180
+)
diff --git a/test/passes/ignore_missing_func.passes b/test/passes/ignore_missing_func.passes
new file mode 100644
index 000000000..a85a46b5e
--- /dev/null
+++ b/test/passes/ignore_missing_func.passes
@@ -0,0 +1 @@
+print_dwarfdump_roundtrip_dwarfdump_g
diff --git a/test/passes/ignore_missing_func.wasm b/test/passes/ignore_missing_func.wasm
new file mode 100644
index 000000000..68c6de155
--- /dev/null
+++ b/test/passes/ignore_missing_func.wasm
Binary files differ