1 \documentclass[12pt,letterpaper,oneside]{memoir}
2 % for debugging, add 'draft' (without quotes) to the [] document class list.
3 % If draft is in the document class list, pix are just suggested
4 % by an outline, the pic does not appear as a picture.
6 \newcommand{\docdate}{November 26, 2016}
9 \newcommand{\ifthen}[2]{\ifthenelse{#1}{#2}{}}
10 \newboolean{isdraft}\setboolean{isdraft}{true}
11 \newboolean{uselinenumbers}\setboolean{uselinenumbers}{true}
12 \newboolean{usechangesummary}\setboolean{usechangesummary}{false}
13 \newcommand{\draftmark}{\ifthenelse{\boolean{isdraft}}{*** PRE-RELEASE STANDARD DRAFT ***}{}}
15 \usepackage[T1]{fontenc}
18 \renewcommand{\ttdefault}{cmtt} % Use Computer Modern Typewriter instead of Courier
19 \usepackage{url} % for color in letters. Links instead?
20 \usepackage[usenames]{color}%for color in letters. Links instead?
21 \usepackage{ellipsis} % provides ... as \dots
22 %\usepackage[utf8]{inputenc}% to type directly diacritic characters
27 language={}, % choose the language of the code
28 basicstyle=\footnotesize\ttfamily, % the size of the fonts that are used for the code
29 numbers=none, % where to put the line-numbers
30 numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers
32 firstnumber=1, % first line number in each listing
33 stepnumber=5, % the step between two line-numbers. If it is 1 each line will be numbered
34 numbersep=10pt, % how far the line-numbers are from the code
35 backgroundcolor=\color{white}, % choose the background color. You must add \usepackage{color}
36 showspaces=false, % show spaces adding particular underscores
37 showstringspaces=false, % underline spaces within strings
38 showtabs=false, % show tabs within strings adding particular underscores
39 frame=single, % adds a frame around the code
40 tabsize=2, % sets default tabsize to 2 spaces
41 captionpos=b, % sets the caption-position to bottom
42 breaklines=true, % sets automatic line breaking
43 breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
44 escapeinside={\%*}{*)} % if you want to add a comment within your code
48 \usepackage{amsmath} % Provides \nobreakdash
49 \usepackage{amssymb} % maths
50 \usepackage{graphicx} % For pictures
51 \usepackage{epstopdf} % Autoconvert .eps to .pdf
52 \epstopdfsetup{suffix=-generated} % Mark generaed PDF as such
53 \usepackage[pagewise]{lineno} % line numbers
55 \setlength\linenumbersep{3em}
56 \renewcommand\linenumberfont{\normalfont\itshape\tiny}
58 \usepackage{longtable} % For multipage tables
59 \usepackage{hhline} % Single column horizontal lines
60 \usepackage{varioref} % defines \vref
61 % \textregistered is the trademark symbol
62 \usepackage[headheight=16pt,paper=letterpaper]{geometry}
63 \setlength{\headheight}{15pt} % avoids warning from latex
64 \usepackage{needspace} % For assuring space remaining on a page
65 \usepackage{ifthen} % For conditional processing
66 \include{dwarfchangebarpatch} % Patch needed for package changebar
67 \usepackage{changepage} % For odd/even page checks
68 \usepackage[usenames,dvipsnames]{xcolor}
69 \usepackage{lscape} % For landscape mode (Appendix B)
70 \usepackage{tikz} % graphics (Name Index (Fig 6.1), Appendix B)
71 \usetikzlibrary{arrows}
72 \usetikzlibrary{arrows.meta}
73 \usetikzlibrary{backgrounds}
75 \usetikzlibrary{chains}
76 \usetikzlibrary{decorations.pathreplacing}
77 \usetikzlibrary{shapes.geometric}
78 \usetikzlibrary{shapes.multipart}
79 \usetikzlibrary{shapes.symbols}
80 \usepackage{changebar} % For change bars in margin
82 \usepackage{makeidx} % For making an index
83 % hyperref must be the last package listed.
84 % The hyperref settings helps hypertext get links right in the
86 % Also, allcolors lets us generate colored active links inside a pdf.
87 % And breaklinks resolves truncation issues with very long link names.
88 \usepackage[breaklinks,plainpages=false,pdfpagelabels,pagebackref,
89 allcolors=blue!80!black,bookmarksnumbered=true]{hyperref}
90 \makeindex % This and the makeidx package allow \index to create index entries.
92 \newcommand{\dwf}{DWARF Debugging Information Format}
94 \newenvironment{myindentpara}[1]%
96 {\setlength{\leftmargin}{#1}}%
101 \hypersetup{colorlinks=true,
103 pdfauthor={\dwf\ Committee},
104 pdftitle={\dwf\ Version 5}
107 % An environment to create a listing-like (boxed) presentation for
108 % DWARF examples Use like \begin{nlnlisting}...\end{nlnlisting}.
109 % Does not do line numbers but does full LaTex processing within its
110 % scope (unlike \verb).
111 \newsavebox{\savedwf}
112 \newenvironment{dwflisting}
113 {\nolinenumbers\begin{lrbox}{\savedwf}\begin{minipage}{\textwidth}\footnotesize}
114 {\end{minipage}\end{lrbox}\fbox{\usebox{\savedwf}}
117 % Conditionally turn on line numbers
118 \newcommand{\condlinenumbers}{\ifthen{\boolean{uselinenumbers}}{\linenumbers}}
120 % An environment that turns off line numbers then conditionally turns
121 % them back on at the end
122 \newenvironment{nolinenumbersenv}
124 {\par\condlinenumbers}
126 % An environment like lstlisting that is wrapped to prevent the
127 % contents of the listing from having line numbers generated by
129 \lstnewenvironment{nlnlisting} % listing-specific newenvironment command
133 % A helper to annotate the parts of a multipage figure
134 \newcommand{\figurepart}[2]{\raggedleft{\textit{\tiny{part #1 of #2}}}}
136 % Define a simple hyper-reference to a given URL
137 \newcommand{\hrefself}[1]{\href{#1}{#1}}
139 % Generate a page ref.
140 % use like \refersec{chap:registervalues}
141 %\newcommand{\refersec}[1]{\ref{#1} on page \pageref{#1}}
142 \newcommand{\refersec}[1]{\vref{#1}} % beware possible rerun loop
143 \newcommand{\referfol}[1]{\ref{#1} following}
145 % Generate a live link in the document that gets indexed as well
146 % Use like \livelink{chap:DWOPdup}{DW\_OP\_dup}
147 \newcommand{\livelink}[2]{\hyperlink{#1}{#2}\index{#2}}
148 % use when the index is different from the text and target.
149 \newcommand{\livelinki}[3]{\hyperlink{#1}{#2}\index{#3}}
150 % livetarg is the declaration that is the target of livelinks.
151 \newcommand{\livetarg}[2]{\hypertarget{#1}{#2}\index{#2}}
152 % When we want the index entry to look different from the name.
153 \newcommand{\livetargi}[3]{\hypertarget{#1}{#2}\index{#3}}
155 \newcommand{\thirtytwobitdwarfformat}[1][]{\livelink{datarep:xxbitdwffmt}{32-bit DWARF format}}
156 \newcommand{\sixtyfourbitdwarfformat}[1][]{\livelink{datarep:xxbitdwffmt}{64-bit DWARF format}}
158 \newcommand{\dash}{\nobreakdash-\hspace{0pt}} % So we handle dashes ok.
160 % The following two let us mark a word as 'do not link' or
161 % 'do not index' to indicate the word is used generically
162 % and has been considered so do not index or link it.
163 % There is no significant difference in the two commands, though
164 % \nolink would be more oriented to words such as flag or address
165 % that might be linked (and indexed) in some circumstances.
166 \newcommand{\nolink}[1]{#1}
167 \newcommand{\noindex}[1]{#1}
169 % For index entries. The tt-variant of each pair is designed to
170 % allow a word to appear in tt font in the main test and the index
171 % but to collate in the index in its non-tt order. Similarly for
172 % the it-variant using italics font.
173 % (LaTex normally % sorts all tt words before all non-tt words.)
174 \newcommand{\addtoindex}[1]{#1\index{#1}}
175 \newcommand{\additindex}[1]{\textit{#1}\index{#1@\textit{#1}}}
176 \newcommand{\addttindex}[1]{\texttt{#1}\index{#1@\texttt{#1}}}
177 \newcommand{\addtoindexi}[2]{#1\index{#2}}
178 \newcommand{\additindexi}[2]{\textit{#1}\index{#2@\textit{#2}}}
179 \newcommand{\addttindexi}[2]{\texttt{#1}\index{#2@\texttt{#2}}}
180 \newcommand{\addtoindexx}[1]{\index{#1}}
181 \newcommand{\additindexx}[1]{\index{#1@\textit{#1}}}
182 \newcommand{\addttindexx}[1]{\index{#1@\texttt{#1}}}
184 % Quote commands that avoid need for inline UTF-8 in these sources
185 \newcommand{\doublequote}[1]{\textquotedblleft #1\textquotedblright}
186 \newcommand{\singlequote}[1]{\textquoteleft #1\textquoteright}
188 % Better naming for the lowest level section header
189 \newcommand{\subsubsubsection}[1]{\paragraph{#1}~\newline}
190 \newcommand{\subsubsubsubsection}[1]{\textbf{#1}.~~}
192 % Start new page if less than n lines remain on current page
193 \newcommand{\needlines}[1]{\needspace{#1\baselineskip}}
195 % Helper for item lists with bold subject markers
196 \newcommand{\itembf}[1]{\needlines{4} \item \textbf{#1}}
197 \newcommand{\itembfnl}[1]{\itembf{#1} \\}
199 % And description lists with normal (not bold) text
200 \renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\textnormal{#1}}
201 \newcommand{\descriptionlabelnl}[1]{\item[#1] \mbox{}\\}
203 % Define an alternate footnote command that creates ragged right text
204 % (using \raggedright in the parameter does not work)
205 \newcommand\footnoteRR[1]{\footnote{\raggedright#1}}
209 \newcommand{\emptypage}{
212 \begin{nolinenumbers}
214 \textit{(empty page)}
219 % Define a new column type P that is just like p except
220 % that it uses ragged right (rather than right justification}
221 % within a column of a tabular environment. (See Goossens,
222 % Mittelback&Samarin, "The LaTex Companion", pp108&114.)
223 \newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp}
224 \newcolumntype{P}[1]{>{\PBS\raggedright\hspace{0pt}}p{#1}}
226 % A simple rule used in simple tables; default length is 2 inches
227 \newcommand{\simplerule}[1][2in]{\rule[4pt]{#1}{0.5pt}}
229 % A simple one column table of names; default width is 2 inches
230 \newcommand{\simplenametablerule}{\simplerule[2in]}
231 \newenvironment{simplenametable}[3][2in]
232 { \begin{table}[ht] \caption{#2} \label{#3}
234 \renewcommand{\simplenametablerule}{\simplerule[#1]}
235 \simplenametablerule \\
236 \begin{tabular*}{#1}{l}
240 \simplenametablerule \\
245 % Complement of \isundefined
246 \newcommand{\isdefined}[1]{\not{\isundefined{#1}}}
248 % Preferred changebar aliases
249 \newcommand{\bb}{\cbstart} % Begin (change) bar
250 \newcommand{\eb}{\cbend} % End (change) bar
251 \newcommand{\bbeb}{\bb\eb} % Mark deleted word or phrase
252 % Mark deleted paragraph
253 \newcommand{\bbpareb}{\vspace{-0.6\baselineskip}\bb~\eb\vspace{-0.6\baselineskip}}
254 % Variations for use inside an alltt environment--But don't work!
255 %\newcommand(\bballtt){\end{alltt}\bb\vspace{-0.8\baselineskip}\begin{alltt}}
256 %\newcommand{\eballtt}{\end{alltt}\eb\vspace{-0.8\baselineskip}\begin{alltt}}
257 %\newcommand(\bbeballtt){\end{alltt}\bb\eb\vspace{-0.8\baselineskip}\begin{alltt}}
259 % Define commands for all of the DWARF names (DW\_*, .debug_*, a few others)
261 %\newcommand{\definition}[1]{\textcolor{red!80!black}{#1}}
262 \newcommand{\definition}[1]{\textcolor{red!65!black}{#1}}
263 \newcommand{\definitionx}[1]{\definition{\addtoindex{#1}}}
264 \include{dwarfnamecmds}
266 % Define commands for pgf use in the name index figure (Fig 6.1)
268 \include{pgfcmdsfornameindexfig}
270 % --------------------------------
271 % --- Begin the document pages ---
272 % --------------------------------
276 \thispagestyle{empty}
279 \setlength{\parindent}{0pt}
280 \setlength{\headheight}{6cm}
281 \setlength{\uppermargin}{6cm}
282 \setlength{\topsep}{0pt}
283 \tightlists % less spacing before/after lists
292 \includegraphics[keepaspectratio=true,scale=1.0]{dwarf-logo}
295 \href{http://www.dwarfstd.org}{\dwf}
296 \href{http://www.dwarfstd.org}{Committee}
299 \url{http://www.dwarfstd.org}
302 {\Large \textbf{\docdate}}
304 \ifthenelse{\boolean{isdraft}}{
312 \setlength{\headheight}{15pt}
314 %\makeevenhead{plain}{}{}{}
315 %\makeoddhead{plain}{}{}{}
316 %\makeevenfoot{plain}{}{}{}
317 %\makeoddfoot{plain}{}{}{}
319 \setlength{\parindent}{0pt}
320 \settrims{0.5in}{0.5in}
321 \settypeblocksize{8.2in}{6.0in}
322 %\setlrmarginsandblock{0.6in}{0.6in}{*}
323 %\setheadfoot{15pt}{15pt}
324 %\setheaderspaces {*}{2\onelineskip}{*}
326 \makeevenhead{plain}{}{\rightmark}{}
327 \makeoddhead{plain}{}{\rightmark}{}
328 \makeevenfoot{plain}{\docdate}{\draftmark}{Page \thepage}
329 \makeoddfoot{plain}{\docdate}{\draftmark}{Page \thepage}
334 \setlength{\parindent}{0pt}
340 ~ % Make the page non-empty...
350 \ifthenelse{\boolean{usechangesummary}}
352 {% Environment to keep the following header change local
354 \makeevenhead{plain}{}{Change Summary}{}
355 \makeoddhead{plain}{}{Change Summary}{}
356 \include{changesummary}
363 \chapterstyle{default}
365 \setlength{\parindent}{0pt}
367 \makepagestyle{fragFirstChPage}
368 \makeevenhead{fragFirstChPage}{}{}{}
369 \makeoddhead{fragFirstChPage}{}{}{}
370 \makeoddfoot{fragFirstChPage}{\docdate}{\draftmark}{Page \thepage}
371 \makeevenfoot{fragFirstChPage}{\docdate}{\draftmark}{Page \thepage}
373 \aliaspagestyle{chapter}{fragFirstChPage}
375 % ----- Start the main part of the document -----
377 % Define the levels of sectionality that are numbered.
378 \setcounter{secnumdepth}{5}
380 \condlinenumbers\include{introduction} \emptypage
381 \condlinenumbers\include{generaldescription} %\emptypage
382 \condlinenumbers\include{programscope} \emptypage
383 \condlinenumbers\include{dataobject} \emptypage
384 \condlinenumbers\include{typeentries} \emptypage
385 \condlinenumbers\include{otherdebugginginformation} %\emptypage
386 \condlinenumbers\include{datarepresentation} %\emptypage
388 % The \appendix command toggles us into appendix chapters
391 \condlinenumbers\include{attributesbytag} %\emptypage
392 \condlinenumbers\include{debugsectionrelationships} \emptypage
393 \condlinenumbers\include{encodingdecoding} \emptypage
394 \condlinenumbers\include{examples} %\emptypage
395 \condlinenumbers\include{compression} \emptypage
396 \condlinenumbers\include{splitobjects} \emptypage
397 \condlinenumbers\include{sectionversionnumbers} \emptypage
399 \include{gnulicense} \emptypage
400 % Maybe someday the selected glossary concept will be of interest...
401 %\include{selectedglossary} %\emptypage
402 \printindex \clearpage