File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Line number information
2
+
3
+ Line number information maps between machine code instructions and the source level location.
4
+
5
+ ## Encoding
6
+
7
+ The line number information is stored in the ` .debug_line ` section for ELF and ` __debug_line `
8
+ section of the ` __DWARF ` segment for Mach-O object files. The line number information contains a
9
+ header followed by the line program. The line program is a program for a virtual machine with
10
+ instructions like set line number for the current machine code instruction and advance the current
11
+ machine code instruction.
12
+
13
+ ## Tips
14
+
15
+ You need to set either ` DW_AT_low_pc ` and ` DW_AT_high_pc ` ** or** ` DW_AT_ranges ` of a
16
+ ` DW_TAG_compilation_unit ` to the range of addresses in the compilation unit. After that you need
17
+ to set ` DW_AT_stmt_list ` to the ` .debug_line ` section offset of the line program. Otherwise a
18
+ debugger won't find the line number information. On macOS the debuginfo relocations ** must** be
19
+ section relative and not symbol relative.
20
+ See [ #303 (comment)] ( https://github.com/bjorn3/rustc_codegen_cranelift/issues/303#issuecomment-457825535 )
21
+ for more information.
You can’t perform that action at this time.
0 commit comments