1 \chapter{Debug Section Relationships (Informative)}
2 \label{app:debugsectionrelationshipsinformative}
3 DWARF information is organized into multiple program sections,
4 each of which holds a particular kind of information. In some
5 cases, information in one section refers to information in one
6 or more of the others. These relationships are illustrated by
7 the diagrams and associated notes on the following pages.
9 In the figures, a section is shown as a shaded oval with the
10 name of the section inside. References from one section to
11 another are shown by an arrow. In the first figure, the arrow
12 is annotated with an unshaded box which contains an indication
13 of the construct (such as an attribute or form) that encodes
14 the reference. In the second figure, this box is left out
15 for reasons of space in favor of a label annotation that is
16 explained in the subsequent notes.
18 \section{Normal DWARF Section Relationships}
19 Figure \referfol{fig:debugsectionrelationships} illustrates
20 the DWARF section relations without split DWARF object files
21 involved. Similarly, it does not show the
22 relationships between the main debugging sections of an executable
23 or sharable file and a related \addtoindex{supplementary object file}.
25 \section{Split DWARF Section Relationships}
26 Figure \ref{fig:splitdwarfsectionrelationships} illustrates
27 the DWARF section relationships for \splitDWARFobjectfile{s}.
28 However, it does not show the
29 relationships between the main debugging sections of an executable
30 or shareable file and a related \addtoindex{supplementary object file}.
36 [sect/.style={rectangle, rounded corners=10pt, draw, fill=blue!15,
37 inner sep=.2cm, minimum width=4.0cm},
38 link/.style={rectangle, draw,
39 inner sep=.2cm, minimum width=4.5cm},
40 circ/.style={circle, draw, fill=yellow!25,
43 % The first (leftmost) column, first sections, then links, from top to bottom
45 \node(zsectara) at ( 0, 15.0) [sect] {\dotdebugaranges};
46 \node(zlinka) at ( 0, 13.5) [link] {To compilation unit~~(a)};
47 \node(zsectinf) at ( 0, 7.5) [sect] {\begin{tabular}{c}
52 \node(zcircs) at (-1.8,4.0) [circ] {\textit{A}};
53 \node(zlinkb) at ( 0, 1.5) [link] {To compilation unit~~(b)};
54 \node(zsectpub) at ( 0,-0.25) [sect] {\begin{tabular}{c}
58 \draw[thin,triangle 45-] (zcircs) -- (zsectinf);
59 \draw[thin,-to reversed] (zlinka) -- (zsectara);
60 \draw[thin,triangle 45-] (zsectinf) -- (zlinka);
61 \draw[thin,-triangle 45] (zlinkb) -- (zsectinf);
62 \draw[thin,to reversed-] (zsectpub) -- (zlinkb);
64 % The second column, similarly
66 \node(zsectfra) at (5, 15.0) [sect] {\dotdebugframe};
67 \node(zlinkc) at (5, 13.5) [link] {To abbreviations~~(c)};
68 \node(zlinkd) at (5, 12.1) [link] {\DWFORMstrp{}~~(d)};
69 \node(zlinke) at (5, 10.4) [link] {\begin{tabular}{c}
70 \DWATstroffsetsbase \\
71 \DWFORMstrx{}~~~~~~~~~(e) \\
73 \node(zlinkf) at (5, 8.4) [link] {\begin{tabular}{c}
74 \DWOPcallref{}~~~~~(f) \\
77 \node(zlinki) at (5, 6.7) [link] {\DWATmacros{}~~(g)};
78 \node(zlinkj) at (5, 5.4) [link] {\DWATstmtlist{}~~(h)};
79 \node(zlinkh) at (5, 3.9) [link] {\begin{tabular}{c}
80 \DWATranges{}~~~~(i) \\
83 \node(zlinkg) at (5, 2.4) [link] {\DWATlocation{}, etc.~~(j)};
84 \node(zlinkk) at (5, 0.5) [link] {\begin{tabular}(c)
91 % Links between first and second columns
93 \draw[thin,to reversed-] (zsectinf) -- (zlinkc.west);
94 \draw[thin,to reversed-] (zsectinf) -- (zlinkd.west);
95 \draw[thin,to reversed-] (zsectinf) -- (zlinke.west);
96 \draw[thin, triangle 45-triangle 45] (zsectinf) -- (zlinkf.west);
97 \draw[thin,to reversed-] (zsectinf) -- (zlinkg.west);
98 \draw[thin,to reversed-] (zsectinf) -- (zlinkh.west);
99 \draw[thin,to reversed-] (zsectinf) -- (zlinki.west);
100 \draw[thin,to reversed-] (zsectinf) -- (zlinkj.west);
101 \draw[thin,to reversed-] (zsectinf) -- (zlinkk.north west);
105 \node(zsectabb) at (10, 15.00) [sect] {\dotdebugabbrev};
106 \node(zsectstr) at (10, 13.75) [sect] {\dotdebugstr};
107 \node(zlinkl) at (10, 12.50) [link] {To strings~~(l)};
108 \node(zsectstx) at (10, 11.25) [sect] {\dotdebugstroffsets};
109 \node(zlinkm) at (10, 9.50) [link] {\begin{tabular}{c}
110 \DWMACROdefinestrx \\
114 \node(zsectmac) at (10, 7.80) [sect] {\dotdebugmacro};
115 \node(zlinkn) at (10, 6.40) [link] {\begin{tabular}{c}
116 macroinfo header~~~~~~(n)\\
119 \node(zsectlin) at (10, 5.00) [sect] {\dotdebugline};
120 \node(zsectran) at (10, 3.85) [sect] {\dotdebugranges};
121 \node(zsectloc) at (10, 2.70) [sect] {\dotdebugloc{}};
122 \node(zlinko) at (10, 1.20) [link] {\begin{tabular}{c}
126 \node(zsectadx) at (10, -0.25) [sect] {\dotdebugaddr{}};
128 \draw[thin,to reversed-] (zsectstx) -- (zlinkl);
129 \draw[thin,-triangle 45] (zlinkl) -- (zsectstr);
130 \draw[thin,to reversed-] (zsectmac) -- (zlinkm);
131 \draw[thin,-triangle 45] (zlinkm) -- (zsectstx);
132 \draw[thin,to reversed-] (zsectmac) -- (zlinkn);
133 \draw[thin,-triangle 45] (zlinkn) -- (zsectlin);
134 \draw[thin,to reversed-] (zsectloc) -- (zlinko);
135 \draw[thin,-triangle 45] (zlinko) -- (zsectadx);
137 % Links between second and third colums
139 \draw[thin,-triangle 45] (zlinkc.east) -- (zsectabb.west);
140 \draw[thin,-triangle 45] (zlinkd.east) -- (zsectstr.west);
141 \draw[thin,-triangle 45] (zlinke.east) -- (zsectstx.west);
142 \draw[thin,-triangle 45] (zlinkg.east) -- (zsectloc.west);
143 \draw[thin,-triangle 45] (zlinkh.east) -- (zsectran.west);
144 \draw[thin,-triangle 45] (zlinki.east) -- (zsectmac.west);
145 \draw[thin,-triangle 45] (zlinkj.east) -- (zsectlin.west);
146 \draw[thin,-triangle 45] (zlinkk.east) -- (zsectadx.west);
150 \node(zlinky) at (15.6, 10.5) [link] {\begin{tabular}{c}
151 \DWMACROdefinestrp \\
155 \node(zlinkz) at (15.6, 6.4) [link] {\begin{tabular}{c}
159 \node(zcircsp) at (17.4, 4.0) [circ] {\textit{A}};
160 \node(zlinkx) at (15.6, 2.0) [link] {\DWFORMlinestrp~(r, s)};
161 \node(zsectlns) at (15.6,-0.25) [sect] {\dotdebuglinestr};
164 \draw[thin,to reversed-] (zsectmac.east) -- (zlinky);
165 \draw[thin,-triangle 45] (zlinky) -- (zsectstr.east);
166 \draw[triangle 45-triangle 45] (zsectmac.east) -- (zlinkz);
167 \draw[thin,to reversed-] (zcircsp) -- (zlinkx);
168 \draw[thin,to reversed-] (zsectlin.east) -- (zlinkx);
169 \draw[thin,-triangle 45] (zlinkx) -- (zsectlns);
173 \caption{Debug section relationships}
174 \label{fig:debugsectionrelationships}
180 \textbf{Notes for Figure \ref{fig:debugsectionrelationships}}
183 \itembfnl{(a) \dotdebugaranges{} to \dotdebuginfo}
184 The \texttt{debug\_info\_offset} value in
186 the offset in the \dotdebuginfo{} section of the
187 corresponding compilation unit header (not the compilation
191 \itembfnl{(b) \dotdebugnames{} to \dotdebuginfo}
192 The list of compilation units following the header contains the offsets in the
193 \dotdebuginfo{} section of the
194 corresponding compilation unit headers (not
195 the compilation unit entries).
198 \itembfnl{(c) \dotdebuginfo{} to \dotdebugabbrev}
199 The \HFNdebugabbrevoffset{} value in the header is the offset in the
201 section of the abbreviations for that compilation unit.
204 \itembfnl{(d) \dotdebuginfo{} to \dotdebugstr}
205 Attribute values of class string may have form
207 value is the offset in the \dotdebugstr{}
208 section of the corresponding string.
211 \itembfnl{(e) \dotdebuginfo{} to \dotdebugstroffsets}
212 The value of the \DWATstroffsetsbase{} attribute in a
213 \DWTAGcompileunit{}, \DWTAGtypeunit{} or \DWTAGpartialunit{}
214 DIE is the offset in the
215 \dotdebugstroffsets{} section of the
216 \addtoindex{string offsets table}
218 In addition, attribute values of class string may have form
219 \DWFORMstrx, whose value is an index into the
220 string offsets table.
223 \itembfnl{(f) \dotdebuginfo{} to \dotdebuginfo}
224 The operand of the \DWOPcallref{}
225 DWARF expression operator is the
226 offset of a debugging information entry in the
227 \dotdebuginfo{} section of another compilation.
228 Similarly for attribute operands that use
232 \itembfnl{(g) \dotdebuginfo{} to \dotdebugmacro}
233 An attribute value of class
234 \livelink{chap:classmacptr}{macptr} (specifically form
235 \DWFORMsecoffset) is an
237 \dotdebugmacro{} section
238 of the beginning of the macro information for the referencing unit.
241 \itembfnl{(h) \dotdebuginfo{} to \dotdebugline}
242 An attribute value of class
243 \livelink{chap:classlineptr}{lineptr} (specifically form
246 \dotdebugline{} section of the
247 beginning of the line number information for the referencing unit.
251 \itembfnl{(i) \dotdebuginfo{} to \dotdebugranges}
252 An attribute value of class \livelink{chap:classrangelistptr}{rangelistptr}
255 is an offset within the \dotdebugranges{} section of
259 \itembfnl{(j) \dotdebuginfo{} to \dotdebugloc}
260 An attribute value of class \livelink{chap:classloclistptr}{loclistptr}
263 is an offset within the \dotdebugloc{}
265 \addtoindex{location list}.
268 \itembfnl{(k) \dotdebuginfo{} to \dotdebugaddr}
269 The value of the \DWATaddrbase{} attribute in the
270 \DWTAGcompileunit{} or \DWTAGpartialunit{} DIE is the
271 offset in the \dotdebugaddr{} section of the machine
272 addresses for that unit.
273 \DWFORMaddrx, \DWOPaddrx{} and \DWOPconstx{} contain
274 indices relative to that offset.
277 \itembfnl{(l) \dotdebugstroffsets{} to \dotdebugstr}
278 Entries in the string offsets table
279 are offsets to the corresponding string text in the
280 \dotdebugstr{} section.
283 \itembfnl{(m) \dotdebugmacro{} to \dotdebugstroffsets}
284 The second operand of a
285 \DWMACROdefinestrx{} or \DWMACROundefstrx{}
286 macro information entry is an index
287 into the string offset table in the
288 \dotdebugstroffsets{} section.
291 \itembfnl{(n) \dotdebugmacro{} to \dotdebugline}
292 The second operand of
293 \DWMACROstartfile{} refers to a file entry in the
294 \dotdebugline{} section relative to the start
295 of that section given in the macro information header.
298 \itembfnl{(o) \dotdebugloc{} to \dotdebugaddr}
299 \DWOPaddrx{} and \DWOPconstx{} operators that occur in the
300 \dotdebugloc{} section refer indirectly to the
301 \dotdebugaddr{} section by way of the
302 \DWATaddrbase{} attribute in the associated \dotdebuginfo{}
306 \itembfnl{(p) \dotdebugmacro{} to \dotdebugstr}
307 The second operand of a
308 \DWMACROdefinestrp{} or \DWMACROundefstrp{} macro information
309 entry is an index into the string table in the
310 \dotdebugstr{} section.
314 \itembfnl{(q) \dotdebugmacro{} to \dotdebugmacro}
316 \DWMACROimport{} macro information
317 entry is an offset into another part of the
318 \dotdebugmacro{} section to the header for the
319 sequence to be replicated.
323 \itembfnl{(r) \dotdebugline{} to \dotdebuglinestr}
324 The value of a \DWFORMlinestrp{} form refers to a
325 string section specific to the line number table.
326 This form can be used in a \dotdebugline{} section
327 (as well as in a \dotdebuginfo{} section).
330 \itembfnl{(s) \dotdebuginfo{} to \dotdebuglinestr}
331 The value of a \DWFORMlinestrp{} form refers to a
332 string section specific to the line number table.
333 This form can be used in a \dotdebuginfo{} section
334 (as well as in a \dotdebugline{} section).\footnote{
335 The circled (s) connects to the circled
336 (s)' via hyperspace (a wormhole).}
346 [sect/.style={rectangle, rounded corners=10pt, draw, fill=blue!15,
347 inner sep=.2cm, minimum width=4.0cm},
348 link/.style={rectangle, draw,
349 inner sep=.2cm, minimum width=4.5cm}]
351 \fill[yellow!25] (7.5,-1) -- (7.5,14.5) -- (19,14.5) -- (19,-1) -- cycle;
353 \node(ysectabb) at ( 5, 13.5) [sect] {\dotdebugabbrev};
354 \node(ysectadd) at ( 2, 12.0) [sect] {\dotdebugaddr};
355 \node(ysectara) at ( 0, 10.5) [sect] {\dotdebugaranges};
356 \node(ysectfra) at ( 0, 9.0) [sect] {\dotdebugframe};
357 \node(ysectlin) at ( 0, 7.5) [sect] {\dotdebugline};
358 \node(ysectlis) at ( 0, 6.0) [sect] {\dotdebuglinestr};
359 \node(ysectnam) at ( 0, 4.5) [sect] {\dotdebugnames};
360 \node(ysectran) at ( 0, 3.0) [sect] {\dotdebugranges};
361 \node(ysectstr) at ( 2, 1.5) [sect] {\dotdebugstr};
362 \node(ysectsto) at ( 5, 0.0) [sect] {\dotdebugstroffsets};
364 \node(ysectinf) at ( 5, 7) [sect] {\begin{tabular}{c}
371 \node(ysectinfdwo) at (10.5,7) [sect] {\begin{tabular}{c}
378 \node(ysectabbdwo) at (10.5, 13.5) [sect] {\dotdebugabbrevdwo};
379 \node(ysectlindwo) at (16.0, 7.5) [sect] {\dotdebuglinedwo};
380 \node(ysectlocdwo) at (16.0, 11.0) [sect] {\dotdebuglocdwo};
381 \node(ysectmacdwo) at (16.0, 4.5) [sect] {\dotdebugmacrodwo};
382 \node(ysectstrdwo) at (13.0, 2.0) [sect] {\dotdebugstrdwo};
383 \node(ysectstodwo) at (10.5, 0.0) [sect] {\dotdebugstroffsetsdwo};
385 \draw[thin,-triangle 45] (ysectinf) -- (ysectabb) node[midway, right] {(c)};
386 \draw[thin,-triangle 45] (ysectinf) -- (ysectadd) node[midway, right] {(k)};
387 \draw[thin,-triangle 45] (ysectara.east) -- (ysectinf) node[midway, left] {(a)};
388 \draw[thin,-triangle 45] (ysectinf) -- (ysectlin.east) node[midway, above] {(h)};
389 \draw[thin,-triangle 45] (ysectlin) -- (ysectlis) node[midway, right] {(l)};
390 \draw[thin,-triangle 45] (ysectnam.east) -- (ysectinf) node[midway, left] {(b)};
391 \draw[thin,-triangle 45] (ysectinf) -- (ysectran.east) node[left, near end] {(i)};
392 \draw[thin,-triangle 45] (ysectinf) -- (ysectstr) node[midway, right] {(d)};
393 \draw[thin,-triangle 45] (ysectinf) -- (ysectsto) node[midway, right] {(e)};
394 \draw[thin,-triangle 45] (ysectsto) -- (ysectstr) node[midway, right] {(l)};
396 \draw[dashed, thick,-triangle 45] (ysectinf) .. controls (7.5, 11) ..(ysectinfdwo)
397 node[midway, above] {(did)};
399 \draw[thin,-triangle 45] (ysectinfdwo) -- (ysectabbdwo) node[midway, right] {(co)};
400 \draw[thin,-triangle 45] (ysectinfdwo) -- (ysectlindwo.west) node[midway, above] {(ho)};
401 \draw[thin,-triangle 45] (ysectinfdwo) -- (ysectlocdwo.west) node[midway, below] {(jo)};
402 \draw[thin,-triangle 45] (ysectinfdwo) -- (ysectmacdwo.west) node[near end, above] {(go)};
403 \draw[thin,-triangle 45] (ysectinfdwo) -- (ysectstrdwo) node[midway, right] {(do)};
404 \draw[thin,-triangle 45] (ysectinfdwo) -- (ysectstodwo) node[midway, left] {(eo)};
406 \draw[thin,-triangle 45] (ysectstodwo) -- (ysectstrdwo) node[near end, below] {(lo)};
407 \draw[thin,-triangle 45] (ysectmacdwo) -- (ysectstrdwo) node[midway, left] {(po)};
408 \draw[thin,-triangle 45] (ysectmacdwo) .. controls (16.5, 1) .. (ysectstodwo.east)
409 node[near start, left] {(mo)};
410 \draw[thin,-triangle 45] (ysectlindwo.east) .. controls (19,4) and (18, 0) .. (ysectstodwo.east)
411 node[very near start, left] {(lmo)};
413 \draw (0, 14) node {\begin{tabular}{l} Skeleton DWARF \\ in executable \end{tabular}};
414 \draw (17, 14) node {\begin{tabular}{r} Split DWARF \\ in separate object \end{tabular}};
417 \caption{Split DWARF section relationships}
418 \label{fig:splitdwarfsectionrelationships}
424 \textbf{Notes for Figure \ref{fig:splitdwarfsectionrelationships}}
427 \itembfnl{(a) \dotdebugaranges{} to \dotdebuginfo}
428 The \texttt{debug\_info\_offset} field in the header is the
429 offset in the \dotdebuginfo{} section of the corresponding
430 compilation unit header of the skeleton \dotdebuginfo{} section
431 (not the compilation unit entry). The
433 \DWATdwoname{} attribute
435 in the \dotdebuginfo{} skeleton
439 the ranges to the full compilation unit in \dotdebuginfodwo.
441 \itembfnl{(b) \dotdebugnames{} to \dotdebuginfo}
442 The \dotdebugnames{} section offsets lists provide an offset
443 for the skeleton compilation unit and eight
444 byte signatures for the type units that appear only in the
445 \dotdebuginfodwo. The DIE offsets for these
446 compilation units and type units refer to the DIEs in the
447 \dotdebuginfodwo{} section for the respective
448 compilation unit and type units.
450 \itembfnl{(c) \dotdebuginfo{} skeleton to \dotdebugabbrev}
451 The \HFNdebugabbrevoffset{} value in the header is
452 the offset in the \dotdebugabbrev{} section of the
453 abbreviations for that compilation unit skeleton.
455 \itembfnl{(co) \dotdebuginfodwo{} to \dotdebugabbrevdwo}
456 The \HFNdebugabbrevoffset{} value in the header
457 is the offset in the \dotdebugabbrevdwo{} section of the
458 abbreviations for that compilation unit.
460 \itembfnl{(d) \dotdebuginfo{} to \dotdebugstr}
461 Attribute values of class string may have form \DWFORMstrp,
462 whose value is an offset in the
463 \dotdebugstr{} section of the corresponding string.
465 \itembfnl{(did) \dotdebuginfo{} to \dotdebuginfodwo}
468 attribute in a skeleton unit identifies the file containing
469 the corresponding \texttt{.dwo} (split) data.
472 \itembfnl{(do) \dotdebuginfodwo{} to \dotdebugstrdwo}
473 Attribute values of class string may have form
474 \DWFORMstrp, whose value is an offset in the
475 \dotdebugstrdwo{} section of the corresponding string.
477 \itembfnl{(e) \dotdebuginfo{} to \dotdebugstroffsets}
478 Attribute values of class string may have form
479 \DWFORMstrx, whose value is an index into the
480 \dotdebugstroffsets{} section for the corresponding string.
483 \itembfnl{(eo)\dotdebuginfodwo{} to \dotdebugstroffsetsdwo}
484 Attribute values of class string may have form
485 \DWFORMstrx, whose value is an index into the
486 \dotdebugstroffsetsdwo{} section for the corresponding string.
488 \itembfnl{(fo) \dotdebuginfodwo{} to \dotdebuginfodwo}
489 The operand of the \DWOPcallref{} DWARF expression
490 operator is the offset of a debugging
491 information entry in the \dotdebuginfodwo{} section of
492 another compilation unit. Similarly for attribute
493 operands that use \DWFORMrefaddr.
494 See Section \refersec{chap:controlflowoperations}.
496 \itembfnl{(go) \dotdebuginfodwo{} to \dotdebugmacrodwo}
497 An attribute of class \CLASSmacptr{} (specifically \DWATmacros{}
498 with form \DWFORMsecoffset{}) is an offset within the
499 \dotdebugmacrodwo{} section of the beginning of the macro
500 information for the referencing unit.
502 \itembfnl{(h) \dotdebuginfo{} (skeleton) to \dotdebugline}
503 An attribute value of class \CLASSlineptr{} (specifically
504 \DWATstmtlist{} with form \DWFORMsecoffset)
505 is an offset within the \dotdebugline{} section of the
506 beginning of the line number information for the
509 \itembfnl{(ho) \dotdebuginfodwo{} to \dotdebuglinedwo{} (skeleton)}
510 An attribute value of class \CLASSlineptr{} (specifically
511 \DWATstmtlist{} with form \DWFORMsecoffset)
512 is an offset within the \dotdebuglinedwo{} section of the
513 beginning of the line number header information
514 for the referencing unit (the line table details are not in
515 \dotdebuglinedwo{} but the line header with its list
516 of file names is present).
518 \itembfnl{(i) \dotdebuginfo{} to \dotdebugranges}
519 An attribute value of class \CLASSrangelistptr{}
520 (specifically \DWATranges{} with form
521 \DWFORMsecoffset) is an offset within the \dotdebugranges{}
522 section of a range list.
524 \itembfnl{(jo) \dotdebuginfodwo{} to \dotdebuglocdwo}
525 An attribute value of class \CLASSloclistptr{} (specifically
526 \DWATdatamemberlocation,
533 \DWATuselocation{} or
534 \DWATvtableelemlocation{}
535 with form \DWFORMsecoffset) is an offset within the
536 \dotdebuglocdwo{} section of a location list. The format of
537 \dotdebuglocdwo{} location list entries is slightly different
538 than that in \dotdebugloc.
539 See Section \refersec{chap:locationlistsinsplitobjectfiles} for details.
542 \itembfnl{(k) \dotdebuginfo{} to \dotdebugaddr}
543 The value of the \DWATaddrbase{} attribute in the
544 \DWTAGcompileunit, \DWTAGpartialunit{} or \DWTAGtypeunit{} DIE
545 is the offset in the \dotdebugaddr{} section of the machine
546 addresses for that unit.
547 \DWFORMaddrx, \DWOPaddrx{} and \DWOPconstx{} contain indices
548 relative to that offset.