Debian Codegraph @

src/bin/dwarfgen/dwarf-generator.txt

raw
1 Speculative thoughts on using a script to define what
2 DWARF? to write out in an elf file:
3
4 Syntax for dw tab entry
5 # is comment
6 levels by indentation like python
7 attrs. indent to the tag they apply to.
8
9 ;section x
10 ;endsection x
11
12 :label:
13 [<level>] tag
14 attr [form name] value
15
16 any attr or tag may have a label.
17
18 Various forms require specific value formats.
19 values sometims require offsets such as a sibling ref
20 or a fwd/rev ref or a ref to the debug_loc sec
21
22
23 DW_FORM_data 1,2 integer
24 DW_FORM_data 4,8 integer or offset depends on context
25 DW_FORM_sdata, udata integer
26 DW_FORM_string "string value"
27 DW_FORM_strp "string value"
28 DW_FORM_block 1,2,4,8 blk-fmt
29
30 this is blk_fmt
31 hex number
32 decimal number
33 [ dw-expr]
34
35
36 sythetic forms:
37 DW_FORM_loclist [label | loclist-itself]
38
39 loclist-itself
40 offset offset DW_FORM_block<n> [blk_fmt]
41 ...
42
43 DW_FORM_maclist label
44 DW_FORM_?
45
46 Line table entries
47
48 CIE entries
49
50 FDE entries
51
52
53 mac sec entries
54
55
56