summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-01-22 08:48:53 -0800
committerGitHub <noreply@github.com>2020-01-22 08:48:53 -0800
commit474269867c54c7f6031bd6797f4fe96db5783c49 (patch)
tree891228ae2340de609264c2bd072d6c0d7e7d2c59 /test
parentd6ce516017f6ea809babb6d81e5bb791ea94659c (diff)
downloadbinaryen-474269867c54c7f6031bd6797f4fe96db5783c49.tar.gz
binaryen-474269867c54c7f6031bd6797f4fe96db5783c49.tar.bz2
binaryen-474269867c54c7f6031bd6797f4fe96db5783c49.zip
DWARF: Track more function locations (#2604)
DWARF from LLVM can refer to the first byte belonging to the function, where the size LEB is, or to the first byte after that, where the local declarations are, or the end opcode, or to one byte past that which is one byte past the bytes that belong to the function. We aren't sure why LLVM does this, but track it all for now. After this all debug line positions are identified. However, in some cases a debug line refers to one past the end of the function, which may be an LLVM bug. That location is ambiguous as it could also be the first byte of the next function (what made this discovery possible was when this happened to the last function, after which there is another section).
Diffstat (limited to 'test')
-rw-r--r--test/passes/fib2.bin.txt16
1 files changed, 12 insertions, 4 deletions
diff --git a/test/passes/fib2.bin.txt b/test/passes/fib2.bin.txt
index 75c58a3d0..e95044c0f 100644
--- a/test/passes/fib2.bin.txt
+++ b/test/passes/fib2.bin.txt
@@ -305,7 +305,7 @@ Contains section .debug_info (168 bytes)
Contains section .debug_loc (143 bytes)
Contains section .debug_ranges (24 bytes)
Contains section .debug_abbrev (131 bytes)
-Contains section .debug_line (194 bytes)
+Contains section .debug_line (210 bytes)
Contains section .debug_str (180 bytes)
.debug_abbrev contents:
@@ -484,7 +484,7 @@ Abbrev table for offset: 0x00000000
.debug_line contents:
debug_line[0x00000000]
Line table prologue:
- total_length: 0x000000be
+ total_length: 0x000000ce
version: 4
prologue_length: 0x0000001e
min_inst_length: 1
@@ -576,12 +576,20 @@ file_names[ 1]:
0x000000af: 00 DW_LNE_end_sequence
0x0000000000000041 12 10 1 0 0 is_stmt end_sequence
-0x000000b2: 00 DW_LNE_set_address (0x0000000000000044)
+0x000000b2: 00 DW_LNE_set_address (0x0000000000000043)
0x000000b9: 03 DW_LNS_advance_line (12)
0x000000bb: 05 DW_LNS_set_column (3)
0x000000bd: 06 DW_LNS_negate_stmt
0x000000be: 0a DW_LNS_set_prologue_end
0x000000bf: 00 DW_LNE_end_sequence
+ 0x0000000000000043 12 3 1 0 0 end_sequence
+
+0x000000c2: 00 DW_LNE_set_address (0x0000000000000044)
+0x000000c9: 03 DW_LNS_advance_line (12)
+0x000000cb: 05 DW_LNS_set_column (3)
+0x000000cd: 06 DW_LNS_negate_stmt
+0x000000ce: 0a DW_LNS_set_prologue_end
+0x000000cf: 00 DW_LNE_end_sequence
0x0000000000000044 12 3 1 0 0 end_sequence
@@ -706,7 +714,7 @@ file_names[ 1]:
;; custom section ".debug_loc", size 143
;; custom section ".debug_ranges", size 24
;; custom section ".debug_abbrev", size 131
- ;; custom section ".debug_line", size 194
+ ;; custom section ".debug_line", size 210
;; custom section ".debug_str", size 180
;; custom section "producers", size 127
)