From 81170075613021ccd8115b2dece13af4488db9c0 Mon Sep 17 00:00:00 2001 From: Ron Brender Date: Tue, 24 Jan 2017 16:24:46 -0500 Subject: [PATCH] Backup of today's work. Still awaiting a couple more editorial inputs. Signed-off-by: Ron Brender --- dwarf5/latexdoc/changesummary.tex | 1 + dwarf5/latexdoc/dataobject.tex | 11 +- dwarf5/latexdoc/datarepresentation.tex | 71 +++++--- dwarf5/latexdoc/debugsectionrelationships.tex | 6 +- dwarf5/latexdoc/dwarf5.tex | 4 +- dwarf5/latexdoc/dwarfnamecmds.tex | 13 +- dwarf5/latexdoc/introduction.tex | 6 +- dwarf5/latexdoc/otherdebugginginformation.tex | 25 ++- dwarf5/latexdoc/programscope.tex | 2 +- dwarf5/latexdoc/splitobjects.tex | 37 ++-- dwarf5/latexdoc/typeentries.tex | 163 ++++++++++-------- 11 files changed, 214 insertions(+), 125 deletions(-) diff --git a/dwarf5/latexdoc/changesummary.tex b/dwarf5/latexdoc/changesummary.tex index 95b4d23..d1df2a0 100644 --- a/dwarf5/latexdoc/changesummary.tex +++ b/dwarf5/latexdoc/changesummary.tex @@ -15,6 +15,7 @@ This change summary is included only in draft versions of this document. \begin{longtable}{ll} \textbf{Date} & \textbf{Issue Incorporated or Other Change} \\ \hline \\ \endhead +1/24/2017 % Changes from meeting of 1/24/2017 \\ 1/18/2017 % 161122.1 (fixed size variants of \DWFORMstrxNAM) \\ 1/16/2017 & Changes from meeting of 1/3/2017 \\ 12/18/2016 & Changes from meeting of 12/6/2016 \\ diff --git a/dwarf5/latexdoc/dataobject.tex b/dwarf5/latexdoc/dataobject.tex index 79d4775..6d69c55 100644 --- a/dwarf5/latexdoc/dataobject.tex +++ b/dwarf5/latexdoc/dataobject.tex @@ -91,10 +91,13 @@ constant or formal parameter. \item If the variable entry represents the defining declaration for a C++ static data member of a structure, class or union, the entry has a \DWATspecification{} attribute, whose value is a -\livelink{chap:classreference}{reference} to the debugging information entry representing the -declaration of this data member. The referenced entry has the -tag \DWTAGmember{} and will be a child of some class, structure -or union type entry. +\livelink{chap:classreference}{reference} to the debugging information +entry representing the declaration of this data member. The referenced +entry +\bb +also has the tag \DWTAGvariable{} +\eb +and will be a child of some class, structure or union type entry. If the variable entry represents a non-defining declaration, \DWATspecification{} may be used diff --git a/dwarf5/latexdoc/datarepresentation.tex b/dwarf5/latexdoc/datarepresentation.tex index 75c8db1..a37a63a 100644 --- a/dwarf5/latexdoc/datarepresentation.tex +++ b/dwarf5/latexdoc/datarepresentation.tex @@ -261,7 +261,7 @@ An address table, in the \dotdebugaddr{} section. This table contains all addresses and constants that require link-time relocation, and items in the table can be referenced indirectly from the debugging information via -the \DWFORMaddrx{} form, +the \DWFORMaddrxXNand{} forms, by the \DWOPaddrx{} and \DWOPconstx{} operators, and by certain of the \texttt{DW\_LLE\_*} location list and \texttt{DW\_RLE\_*} range list entries. @@ -281,6 +281,7 @@ table is necessary only if the skeleton compilation unit uses one of the indirect string forms (\DWFORMstrp{}, \DWFORMstrxXNor). \eb +\needlines{4} \item A string offsets table, in the \dotdebugstroffsets{} section for strings in the \dotdebugstr{} section. @@ -307,8 +308,12 @@ file. This partition includes the following: The full compilation unit, in the \dotdebuginfodwo{} section. Attributes contained in the full compilation unit -may refer to machine addresses indirectly using the \DWFORMaddrx{} -form, which accesses the table of addresses specified by the +may refer to machine addresses indirectly using +\bb +one of the +\eb +\DWFORMaddrxXNor{} +forms, which access the table of addresses specified by the \DWATaddrbase{} attribute in the associated skeleton unit. Location descriptions may similarly do so using the \DWOPaddrx{} and \DWOPconstx{} operations. @@ -415,7 +420,7 @@ corresponding application binary. It consists only of a file header, a section table, a number of DWARF debug information sections, and two index sections. -\needlines{10} +%\needlines{8} Each DWARF package file contains no more than one of each of the following sections, copied from a set of object or DWARF object files, and combined, section by section: @@ -979,10 +984,9 @@ enumeration are shown in Table \refersec{tab:unitheaderunitkindencodings}. \end{centering} \bb -All unit headers have the same initial three fields. +All unit headers have the same initial three fields: \HFNinitiallength, \HFNversion{} and \HFNunittype. \eb - \needlines{5} \bb \subsubsection{Full and Partial Compilation Unit Headers} @@ -1215,7 +1219,7 @@ unit. the primary type contained in this \addtoindex{type unit} uses this value.} -%\needlines{8} +\needlines{8} \item \texttt{type\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\ \addttindexx{type\_offset} A 4-byte or 8-byte unsigned offset @@ -1846,11 +1850,20 @@ This address is relocatable in a relocatable object file and is relocated in an executable file or shared object file. \item An indirect index into a table of addresses (as -described in the previous bullet) in the -\dotdebugaddr{} section (\DWFORMaddrxTARG). +described in the previous bullet) in the \dotdebugaddr{} section +\bb +(\DWFORMaddrxTARG, \DWFORMaddrxoneTARG, \DWFORMaddrxtwoTARG, +\DWFORMaddrxthreeTARG{} and \DWFORMaddrxfourTARG). +\eb The representation of a \DWFORMaddrxNAME{} value is an unsigned \addtoindex{LEB128} value, which is interpreted as a zero-based index into an array of addresses in the \dotdebugaddr{} section. +\bb +The representation of a \DWFORMaddrxoneNAME, \DWFORMaddrxtwoNAME, +\DWFORMaddrxthreeNAME{} or \DWFORMaddrxfourNAME{} value is a +1-, 2-, 3- or 4-byte unsigned integer value, respectively, +which is similarly interpretated. +\eb The index is relative to the value of the \DWATaddrbase{} attribute of the associated compilation unit. @@ -1951,7 +1964,7 @@ The information bytes contain a DWARF expression or location description (see Section \refersec{chap:locationdescriptions}). -\needlines{4} +\needlines{8} \item \CLASSflag \\ \livetarg{datarep:classflag}{} A flag \addtoindexx{flag class} @@ -2083,7 +2096,7 @@ format, it is an 8-byte unsigned value (see Section \textit{This class is new in \DWARFVersionV.} -\needlines{4} +\needlines{8} \item \CLASSreference \\ \livetarg{datarep:classreference}{} There are four types of reference.\addtoindexx{reference class} @@ -2189,10 +2202,10 @@ one null byte. A string may be represented: \begin{itemize} \setlength{\itemsep}{0em} -\item immediately in the debugging information entry itself +\item Immediately in the debugging information entry itself (\DWFORMstringTARG), -\item as an +\item As an \addtoindexx{section offset!in class string value} offset into a string table contained in the \dotdebugstr{} section of the object file (\DWFORMstrpTARG), @@ -2213,7 +2226,7 @@ it is an 8-byte unsigned offset (see Section \refersec{datarep:32bitand64bitdwarfformats}). \needlines{6} -\item as an indirect offset into the string table using an +\item As an indirect offset into the string table using an index into a table of offsets contained in the \dotdebugstroffsets{} section of the object file \bb @@ -2326,23 +2339,27 @@ Table \referfol{tab:attributeformencodings}. & & \CLASSmacptr, \CLASSrnglist, \CLASSrnglistsptr, \CLASSstroffsetsptr \\ \DWFORMexprloc{} &0x18&\livelink{chap:classexprloc}{exprloc} \\ \DWFORMflagpresent{} &0x19&\livelink{chap:classflag}{flag} \\ -\DWFORMstrx{} \ddag &0x1a&\livelink{chap:classstring}{string} \\ -\DWFORMaddrx{} \ddag &0x1b&\livelink{chap:classaddress}{address} \\ -\DWFORMrefsupfour{}~\ddag &0x1c &\livelink{chap:classreference}{reference} \\ -\DWFORMstrpsup{}~\ddag &0x1d &\livelink{chap:classstring}{string} \\ -\DWFORMdatasixteen~\ddag &0x1e &\CLASSconstant \\ -\DWFORMlinestrp~\ddag &0x1f &\CLASSstring \\ -\DWFORMrefsigeight &0x20 &\livelink{chap:classreference}{reference} \\ +\DWFORMstrx{} \ddag &0x1a &\CLASSstring \\ +\DWFORMaddrx{} \ddag &0x1b &\CLASSaddress \\ +\DWFORMrefsupfour{}~\ddag &0x1c &\CLASSreference \\ +\DWFORMstrpsup{}~\ddag &0x1d &\CLASSstring \\ +\DWFORMdatasixteen~\ddag &0x1e &\CLASSconstant \\ +\DWFORMlinestrp~\ddag &0x1f &\CLASSstring \\ +\DWFORMrefsigeight &0x20 &\CLASSreference \\ \DWFORMimplicitconst~\ddag &0x21 &\CLASSconstant \\ -\DWFORMloclistx~\ddag &0x22 &\CLASSloclist \\ -\DWFORMrnglistx~\ddag &0x23 &\CLASSrnglist \\ +\DWFORMloclistx~\ddag &0x22 &\CLASSloclist \\ +\DWFORMrnglistx~\ddag &0x23 &\CLASSrnglist \\ \DWFORMrefsupeight{}~\ddag &0x24 &\CLASSreference \\ \bb -\DWFORMstrxone{}~\ddag &0x25 &\CLASSstring \\ -\DWFORMstrxtwo{}~\ddag &0x26 &\CLASSstring \\ -\DWFORMstrxthree{}~\ddag &0x27 &\CLASSstring \\ +\DWFORMstrxone{}~\ddag &0x25 &\CLASSstring \\ +\DWFORMstrxtwo{}~\ddag &0x26 &\CLASSstring \\ +\DWFORMstrxthree{}~\ddag &0x27 &\CLASSstring \\ +\DWFORMstrxfour{}~\ddag &0x28 &\CLASSstring \\ +\DWFORMaddrxone{}~\ddag &0x29 &\CLASSaddress \\ +\DWFORMaddrxtwo{}~\ddag &0x2a &\CLASSaddress \\ +\DWFORMaddrxthree{}~\ddag &0x2b &\CLASSaddress \\ \eb -\DWFORMstrxfour{}~\ddag &0x28 &\CLASSstring \\ +\DWFORMaddrxfour{}~\ddag &0x2c &\CLASSaddress \\ \end{longtable} \end{centering} diff --git a/dwarf5/latexdoc/debugsectionrelationships.tex b/dwarf5/latexdoc/debugsectionrelationships.tex index 4bb607a..058998a 100644 --- a/dwarf5/latexdoc/debugsectionrelationships.tex +++ b/dwarf5/latexdoc/debugsectionrelationships.tex @@ -83,7 +83,7 @@ or shareable file and a related \addtoindex{supplementary object file}. \node(zlinkg) at (5, 2.4) [link] {\DWATlocation{}, etc.~~(j)}; \node(zlinkk) at (5, 0.5) [link] {\begin{tabular}(c) \DWATaddrbase \\ - \DWFORMaddrx \\ + \DWFORMaddrx\textit{[1,2,3,4]}{} \\ \DWOPaddrx \\ \DWOPconstx \end{tabular} (k)}; @@ -270,7 +270,7 @@ The value of the \DWATaddrbase{} attribute in the \DWTAGcompileunit{} or \DWTAGpartialunit{} DIE is the offset in the \dotdebugaddr{} section of the machine addresses for that unit. -\DWFORMaddrx, \DWOPaddrx{} and \DWOPconstx{} contain +\DWFORMaddrxXN, \DWOPaddrx{} and \DWOPconstx{} contain indices relative to that offset. %l @@ -540,7 +540,7 @@ The value of the \DWATaddrbase{} attribute in the \DWTAGcompileunit, \DWTAGpartialunit{} or \DWTAGtypeunit{} DIE is the offset in the \dotdebugaddr{} section of the machine addresses for that unit. -\DWFORMaddrx, \DWOPaddrx{} and \DWOPconstx{} contain indices +\DWFORMaddrxXN, \DWOPaddrx{} and \DWOPconstx{} contain indices relative to that offset. \end{description} \ No newline at end of file diff --git a/dwarf5/latexdoc/dwarf5.tex b/dwarf5/latexdoc/dwarf5.tex index a17b864..d018d5f 100644 --- a/dwarf5/latexdoc/dwarf5.tex +++ b/dwarf5/latexdoc/dwarf5.tex @@ -3,7 +3,7 @@ % If draft is in the document class list, pix are just suggested % by an outline, the pic does not appear as a picture. % -\newcommand{\docdate}{January 18, 2017} +\newcommand{\docdate}{January 24, 2017} % \usepackage{ifthen} \newcommand{\ifthen}[2]{\ifthenelse{#1}{#2}{}} @@ -381,7 +381,7 @@ escapeinside={\%*}{*)} % if you want to add a comment within your code \condlinenumbers\include{generaldescription} %\emptypage \condlinenumbers\include{programscope} \emptypage \condlinenumbers\include{dataobject} \emptypage -\condlinenumbers\include{typeentries} \emptypage +\condlinenumbers\include{typeentries} %\emptypage \condlinenumbers\include{otherdebugginginformation} %\emptypage \condlinenumbers\include{datarepresentation} %\emptypage diff --git a/dwarf5/latexdoc/dwarfnamecmds.tex b/dwarf5/latexdoc/dwarfnamecmds.tex index 79f0d18..0fa1de8 100644 --- a/dwarf5/latexdoc/dwarfnamecmds.tex +++ b/dwarf5/latexdoc/dwarfnamecmds.tex @@ -282,6 +282,10 @@ % \newdwfnamecommands{DWFORMaddr}{DW\_FORM\_addr} \newdwfnamecommands{DWFORMaddrx}{DW\_FORM\_addrx} +\newdwfnamecommands{DWFORMaddrxone}{DW\_FORM\_addrx1} +\newdwfnamecommands{DWFORMaddrxtwo}{DW\_FORM\_addrx2} +\newdwfnamecommands{DWFORMaddrxthree}{DW\_FORM\_addrx3} +\newdwfnamecommands{DWFORMaddrxfour}{DW\_FORM\_addrx4} \newdwfnamecommands{DWFORMblock}{DW\_FORM\_block} \newdwfnamecommands{DWFORMblockone}{DW\_FORM\_block1} \newdwfnamecommands{DWFORMblocktwo}{DW\_FORM\_block2} @@ -321,11 +325,17 @@ \newdwfnamecommands{DWFORMstrxthree}{DW\_FORM\_strx3} \newdwfnamecommands{DWFORMstrxfour}{DW\_FORM\_strx4} \newdwfnamecommands{DWFORMudata}{DW\_FORM\_udata} +% Helpers for lists of addrx forms +\newcommand{\DWFORMaddrxN} {\bb\DWFORMaddrxone, \DWFORMaddrxtwo, \DWFORMaddrxthree, \DWFORMaddrxfour\eb} % fixed size +\newcommand{\DWFORMaddrxNor} {\bb\DWFORMaddrxone, \DWFORMaddrxtwo, \DWFORMaddrxthree{} or \DWFORMaddrxfour\eb} % fixed size +\newcommand{\DWFORMaddrxNand}{\bb\DWFORMaddrxone, \DWFORMaddrxtwo, \DWFORMaddrxthree{} and \DWFORMaddrxfour\eb} % fixed size +\newcommand{\DWFORMaddrxXN} {\DWFORMaddrx, \DWFORMaddrxN} % all +\newcommand{\DWFORMaddrxXNor} {\DWFORMaddrx, \DWFORMaddrxNor} % all +\newcommand{\DWFORMaddrxXNand}{\DWFORMaddrx, \DWFORMaddrxNand} % all % Helpers for lists of strx forms \newcommand{\DWFORMstrxN} {\bb\DWFORMstrxone, \DWFORMstrxtwo, \DWFORMstrxthree, \DWFORMstrxfour\eb} % fixed size \newcommand{\DWFORMstrxNor} {\bb\DWFORMstrxone, \DWFORMstrxtwo, \DWFORMstrxthree{} or \DWFORMstrxfour\eb} % fixed size \newcommand{\DWFORMstrxNand}{\bb\DWFORMstrxone, \DWFORMstrxtwo, \DWFORMstrxthree{} and \DWFORMstrxfour\eb} % fixed size - \newcommand{\DWFORMstrxXN} {\DWFORMstrx, \DWFORMstrxN} % all \newcommand{\DWFORMstrxXNor} {\DWFORMstrx, \DWFORMstrxNor} % all \newcommand{\DWFORMstrxXNand}{\DWFORMstrx, \DWFORMstrxNand} % all @@ -840,6 +850,7 @@ \newcommand{\HFNflags} {\addttindex{flags}} \newcommand{\HFNheaderlength} {\addttindex{header\_length}} \newcommand{\HFNinitialinstructions} {\addttindex{initial\_instructions}} +\newcommand{\HFNinitiallength} {\addttindex{initial\_length}} \newcommand{\HFNinitiallocation} {\addttindex{initial\_location}} \newcommand{\HFNinstructions} {\addttindex{instructions}} \newcommand{\HFNlength} {\addttindex{length}} diff --git a/dwarf5/latexdoc/introduction.tex b/dwarf5/latexdoc/introduction.tex index 9b0e46d..b212850 100644 --- a/dwarf5/latexdoc/introduction.tex +++ b/dwarf5/latexdoc/introduction.tex @@ -410,7 +410,11 @@ In addition, the \HFNdebugabbrevoffset{} and \HFNaddresssize{} fields are reorde \eb \needlines{4} \item New operand forms for attribute values are defined -(\DWFORMaddrxNAME, \DWFORMdatasixteenNAME, \DWFORMimplicitconstNAME, +(\DWFORMaddrxNAME, +\bb +\DWFORMaddrxoneNAME, \DWFORMaddrxtwoNAME, \DWFORMaddrxthreeNAME, \DWFORMaddrxfourNAME, +\eb +\DWFORMdatasixteenNAME, \DWFORMimplicitconstNAME, \DWFORMlinestrpNAME, \DWFORMloclistxNAME, \DWFORMrnglistxNAME, \bb diff --git a/dwarf5/latexdoc/otherdebugginginformation.tex b/dwarf5/latexdoc/otherdebugginginformation.tex index a3d5d52..0421a6c 100644 --- a/dwarf5/latexdoc/otherdebugginginformation.tex +++ b/dwarf5/latexdoc/otherdebugginginformation.tex @@ -643,6 +643,7 @@ only needs to find one declaration. Likewise, a per-module index needs to list only a single copy of a type declaration contained in a type unit.} +\needlines{4} \textit{For the benefit of link-time or post-link utilities that consume per-CU indexes and produce a per-module index, the per-CU index entries provide the tag encoding for the original debugging @@ -710,8 +711,13 @@ contents and interpretation are not specified here. The string is padded with null characters to a multiple of four bytes in length. -\textit{The presence of an unrecognised augmentation string may make it impossible -for a consumer to process data in the \dotdebugnames{} section.} +\textit{The presence of an unrecognised augmentation string +\bb +does not make it +impossible for a consumer to process data in the \dotdebugnames{} section. +The augmentation string only provides hints to the consumer regarding +the completeness of the set of names in the index. +\eb} \end{enumerate} @@ -776,12 +782,12 @@ table. the same slot, but the consumer will be able to distinguish the names when appropriate.} -\textit{The simple case folding algorithm is further described +The simple case folding algorithm is further described in the CaseFolding.txt file distributed with the \addtoindex{Unicode} Character Database. That file defines four classes of mappings: Common (C), Simple (S), Full (F), and Turkish (T). The hash computation specified here uses the C + S mappings only, -which do not affect the total length of the string.} +which do not affect the total length of the string. \eb Each bucket contains the index of an entry in the hashes array. The @@ -854,8 +860,9 @@ specifications ends with an entry containing 0 for the attribute and 0 for the form. The index attributes and their meanings are listed in -Table \referfol{tab:indexattributeencodings}. +Table \refersec{tab:indexattributeencodings}. +\begin{table} \begin{centering} \setlength{\extrarowheight}{0.1cm} \begin{longtable}{l|l} @@ -875,12 +882,14 @@ Table \referfol{tab:indexattributeencodings}. \DWIDXtypehashTARG & Hash of type \mbox{declaration} \\ \end{longtable} \end{centering} +\end{table} The abbreviations table ends with an entry consisting of a single 0 byte for the abbreviation code. The size of the table given by \texttt{abbrev\_table\_size} may include optional padding following the terminating 0 byte. +\needlines{4} \subsubsubsection{Entry Pool} The entry pool immediately follows the abbreviations table. Each entry in the entry offsets array in the name table (see @@ -1233,6 +1242,7 @@ consumers in decoding the line number program instructions for a particular compilation unit and also provides information used throughout the rest of the line number program. +\needlines{4} The line number program for each compilation unit begins with a header containing the following fields in order: @@ -1749,6 +1759,7 @@ field is 1, \texttt{op\_index} is always 0 and these calculations simplify to those given for addresses in \DWARFVersionIII{} and earlier.} +\needlines{4} The amount to increment the line register is the \addttindex{line\_base} plus the result of the @@ -1825,6 +1836,7 @@ takes no operands. It sets the \addttindex{basic\_block} register of the state machine to \doublequote{true.} +\needlines{4} \item \textbf{\DWLNSconstaddpcTARG} \\ The \DWLNSconstaddpcNAME{} opcode takes no operands. It advances the \texttt{address} and \addttindex{op\_index} registers @@ -1885,7 +1897,7 @@ it must be determined in combination with the subroutine information entries of the compilation (including inlined subroutines).} - +\needlines{4} \item \textbf{\DWLNSsetepiloguebeginTARG} \\ The \DWLNSsetepiloguebeginNAME{} opcode takes no operands. It sets the \addttindex{epilogue\_begin} register to \doublequote{true.} @@ -1949,6 +1961,7 @@ sets the \addttindex{op\_index} register to 0. affect the \texttt{address} register add a delta to it. This instruction stores a relocatable value into it instead.} +\needlines{4} \item \textbf{\DWLNEsetdiscriminatorTARG} \\ The \DWLNEsetdiscriminatorNAME{} opcode takes a single diff --git a/dwarf5/latexdoc/programscope.tex b/dwarf5/latexdoc/programscope.tex index 8f94a13..461c0e2 100644 --- a/dwarf5/latexdoc/programscope.tex +++ b/dwarf5/latexdoc/programscope.tex @@ -442,7 +442,7 @@ A \DWATaddrbaseDEFN\addtoindexx{address table base attribute} attribute, whose value is of class \CLASSaddrptr. This attribute points to the beginning of the compilation unit's contribution to the \dotdebugaddr{} section. -Indirect references (using \DWFORMaddrx, \DWOPaddrx, +Indirect references (using \DWFORMaddrxXN, \DWOPaddrx, \DWOPconstx, \bb \DWLLEbaseaddressx{}, \DWLLEstartxendx{}, \DWLLEstartxlength{}, diff --git a/dwarf5/latexdoc/splitobjects.tex b/dwarf5/latexdoc/splitobjects.tex index c54a966..ecba136 100644 --- a/dwarf5/latexdoc/splitobjects.tex +++ b/dwarf5/latexdoc/splitobjects.tex @@ -119,9 +119,12 @@ output binary include the following: skeleton \dotdebuginfo{} section. \item \dotdebugaddr{} - Contains references to loadable sections, -indexed by attributes of form \DWFORMaddrx{} or location -expression -\DWOPaddrx{} opcodes. +indexed by attributes of +\bb +one of the forms +\eb +\DWFORMaddrxXN{}, +or location expression \DWOPaddrx{} opcodes. \item \dotdebugaranges{} - Contains the accelerated range lookup table for the compilation unit. @@ -201,7 +204,11 @@ one \dotdwo{} section to another \dotdwo{} section in the same compilation unit. \item Some values that need a relocation to refer to a relocatable -program address use the \DWFORMaddrx{} form, referencing a relocatable +program address use +\bb +one of the \DWFORMaddrxXNor{} forms, +\eb +referencing a relocatable value in the \dotdebugaddr{} section (which remains in the .o file). \end{enumerate} @@ -556,7 +563,11 @@ begins at offset 48. Because the \dotdebugaddr{} section contains an actually begins at offset 40 (for a 64-bit DWARF object, the header would be 16 bytes long, and the value for the \DWATaddrbase{} attribute would then be 56). All attributes in -\texttt{demo1.dwo} that use \DWFORMaddrx{} would then refer to address +\texttt{demo1.dwo} that use +\bb +\DWFORMaddrxXNor{} +\eb +would then refer to address table slots relative to that offset. Likewise, the \dotdebugaddr{} contribution from \texttt{demo2.dwo} begins at offset 72, and its first address slot is at offset 80. Because these contributions have @@ -602,8 +613,11 @@ form code \DWFORMstrxXNor, referring to slots in the \dotdebugstroffsetsdwo{} section. \needlines{4} -\item References to relocatable addresses in the object file -use the form code \DWFORMaddrx, referring to slots in the +\item References to relocatable addresses in the object file use +\bb +one of the form codes +\eb +\DWFORMaddrxXNor, referring to slots in the \dotdebugaddr{} table, relative to the base offset given by \DWATaddrbase{} in the skeleton compilation unit. \end{itemize} @@ -715,8 +729,11 @@ Figure~\ref{fig:splitobjectexampledemoonedwodwarfexcerpts}: Split object example \needlines{4} In the defining declaration for \texttt{Box::contains} at 5\$, the -\DWATlowpc{} attribute is represented with \DWFORMaddrx, -referring to slot 0 in the \dotdebugaddr{} table from \texttt{demo1.o}. +\DWATlowpc{} attribute is represented +\bb +using \DWFORMaddrx, which refers +\eb +to slot 0 in the \dotdebugaddr{} table from \texttt{demo1.o}. That slot contains the relocated address of the beginning of the function. @@ -1044,6 +1061,7 @@ is also copied. The type units for class \texttt{Box} and class and \texttt{demo2.dwo}, but only one instance of each is copied into the package file. +\needlines{4} The \dotdebugstrdwo{} sections from each file are merged to form a new string table with no duplicates, requiring the adjustment of all references to those strings. The @@ -1052,7 +1070,6 @@ are copied as individual contributions, but the string table offset in each slot of those contributions is adjusted to point to the correct offset in the merged string table. -\needlines{4} The \dotdebugcuindex{} and \dotdebugtuindex{} sections provide a directory to these contributions. Figure \referfol{fig:examplecuindexsection} shows an example CU diff --git a/dwarf5/latexdoc/typeentries.tex b/dwarf5/latexdoc/typeentries.tex index 7b70c13..4cc52a2 100644 --- a/dwarf5/latexdoc/typeentries.tex +++ b/dwarf5/latexdoc/typeentries.tex @@ -313,6 +313,7 @@ with a \DWATpicturestringDEFN{} attribute whose value is a null\dash terminated string containing the target\dash dependent picture string associated with the type. +\needlines{4} If the edited base type entry describes an edited numeric data type, the edited type entry has a \DWATdigitcount{} and a \DWATdecimalscale{} attribute.\addtoindexx{decimal scale attribute} @@ -395,17 +396,66 @@ in different languages. A type modifier is represented in DWARF by a debugging information entry with one of the tags given in Table \refersec{tab:typemodifiertags}. +\begin{table}[h] +\caption{Type modifier tags} +\label{tab:typemodifiertags} +\centering +\begin{tabular}{l|P{9cm}} +\hline +Name&Meaning\\ \hline +\DWTAGatomictypeTARG{} & + atomic qualified type + (for example, in C) + \addtoindexx{atomic qualified type entry} \addtoindexx{C} \\ +\DWTAGconsttypeTARG{} & + const qualified type + (for example in C, C++) + \addtoindexx{const qualified type entry} \addtoindexx{C} \addtoindexx{C++} \\ +\DWTAGimmutabletypeTARG & + immutable type + (for example, in \addtoindex{D}) + \addtoindexx{immutable type} \\ +\DWTAGpackedtypeTARG & + packed type\addtoindexx{packed type entry} + (for example in Ada, Pascal) + \addtoindexx{packed qualified type entry} \addtoindexx{Ada} \addtoindexx{Pascal} \\ +\DWTAGpointertypeTARG{} & + pointer to an object of the type being modified + \addtoindexx{pointer qualified type entry} \\ +\DWTAGreferencetypeTARG & + reference to (lvalue of) an object of the type \mbox{being} modified + \addtoindexx{reference type entry} + \addtoindexx{reference qualified type entry} \\ +\DWTAGrestricttypeTARG & + restrict qualified type + \addtoindexx{restricted type entry} + \addtoindexx{restrict qualified type} \addtoindexx{C} \\ +\DWTAGrvaluereferencetypeTARG{} & + rvalue reference to an object of the type \mbox{being} modified + (for example, in \addtoindex{C++}) + \addtoindexx{rvalue reference type entry} + \addtoindexx{restricted type entry} + \addtoindexx{rvalue reference qualified type entry} \\ +\DWTAGsharedtypeTARG & + shared qualified type + (for example, in \addtoindex{UPC}) + \addtoindexx{shared qualified type entry} \\ +\DWTAGvolatiletypeTARG & + volatile qualified type + (for example, in \addtoindex{C}, \addtoindex{C++}) + \addtoindexx{volatile qualified type entry} \\ +\hline +\end{tabular} +\end{table} + If a name has been given to the modified type in the source program, then the corresponding modified type entry has -a \DWATname{} attribute -\addtoindexx{name attribute} -whose value is a null\dash terminated -string containing the modified type name. +a \DWATname{} attribute\addtoindexx{name attribute} +whose value is a null-terminated string containing +the name of the modified type. -Each of the type modifier entries has -\addtoindexx{type attribute} -a -\DWATtype{} attribute, +Each of the type modifier entries has a +\DWATtype{} attribute\addtoindexx{type attribute}, whose value is a \livelink{chap:classreference}{reference} to a debugging information entry describing a base type, a user-defined type or another type @@ -456,68 +506,20 @@ source \addtoindexx{parameter|see{formal parameter entry}} presentation. -\begin{table}[ht] -\caption{Type modifier tags} -\label{tab:typemodifiertags} -\centering -\begin{tabular}{l|P{9cm}} -\hline -Name&Meaning\\ \hline -\DWTAGatomictypeTARG{} & - atomic qualified type - (for example, in C) - \addtoindexx{atomic qualified type entry} \addtoindexx{C} \\ -\DWTAGconsttypeTARG{} & - const qualified type - (for example in C, C++) - \addtoindexx{const qualified type entry} \addtoindexx{C} \addtoindexx{C++} \\ -\DWTAGimmutabletypeTARG & - immutable type - (for example, in \addtoindex{D}) - \addtoindexx{immutable type} \\ -\DWTAGpackedtypeTARG & - packed type\addtoindexx{packed type entry} - (for example in Ada, Pascal) - \addtoindexx{packed qualified type entry} \addtoindexx{Ada} \addtoindexx{Pascal} \\ -\DWTAGpointertypeTARG{} & - pointer to an object of the type being modified - \addtoindexx{pointer qualified type entry} \\ -\DWTAGreferencetypeTARG & - reference to (lvalue of) an object of the type \mbox{being} modified - \addtoindexx{reference type entry} - \addtoindexx{reference qualified type entry} \\ -\DWTAGrestricttypeTARG & - restrict qualified type - \addtoindexx{restricted type entry} - \addtoindexx{restrict qualified type} \addtoindexx{C} \\ -\DWTAGrvaluereferencetypeTARG{} & - rvalue reference to an object of the type \mbox{being} modified - (for example, in \addtoindex{C++}) - \addtoindexx{rvalue reference type entry} - \addtoindexx{restricted type entry} - \addtoindexx{rvalue reference qualified type entry} \\ -\DWTAGsharedtypeTARG & - shared qualified type - (for example, in \addtoindex{UPC}) - \addtoindexx{shared qualified type entry} \\ -\DWTAGvolatiletypeTARG & - volatile qualified type - (for example, in \addtoindex{C}, \addtoindex{C++}) - \addtoindexx{volatile qualified type entry} \\ -\hline -\end{tabular} -\end{table} +\bb +Examples of modified types are shown in Figure \refersec{fig:typemidifierexamples}. +\eb -\needlines{6} +\begin{figure}[t] \textit{As examples of how type modifiers are ordered, consider the following \addtoindex{C} declarations:} \par % Needed to end paragraph before listing so that it gets a line number \begin{nlnlisting} - const unsigned char * volatile p; + const unsigned char * volatile p; \end{nlnlisting} \textit{This represents a volatile pointer to a constant -character. It is encoded in DWARF as:} +character. It is encoded in DWARF as} \par % Needed to end paragraph before listing so that it gets a line number \nolinenumbers \begin{dwflisting} @@ -530,16 +532,12 @@ character. It is encoded in DWARF as:} \end{alltt} \end{dwflisting} -\condlinenumbers \textit{On the other hand} -\par % Needed to end paragraph before listing so that it gets a line number \begin{nlnlisting} - volatile unsigned char * const restrict p; + volatile unsigned char * const restrict p; \end{nlnlisting} \textit{represents a restricted constant -pointer to a volatile character. This is encoded as:} -\par % Needed to end paragraph before listing so that it gets a line number -\nolinenumbers +pointer to a volatile character. This is encoded as} \begin{dwflisting} \begin{alltt} \DWTAGvariable(p) --> @@ -551,7 +549,10 @@ pointer to a volatile character. This is encoded as:} \end{alltt} \end{dwflisting} -\condlinenumbers +\caption{Type modifier examples} +\label{fig:typemidifierexamples} +\end{figure} + \section{Typedef Entries} \label{chap:typedefentries} A named type that is defined in terms of another type @@ -573,6 +574,7 @@ the debugging information entry for a typedef represents a declaration of the type that is not also a definition, it does not contain a type attribute. +\needlines{4} \textit{Depending on the language, a named type that is defined in terms of another type may be called a type alias, a subtype, a constrained type and other terms. A type name declared with @@ -659,7 +661,6 @@ amount of storage needed to hold an instance of the array type. compile time, this value can usually be computed by multiplying the number of array elements by the size of each element.} - Each array dimension is described by a debugging information entry with either the \addtoindexx{subrange type entry!as array dimension} @@ -719,6 +720,7 @@ coarray type in the source, then the corresponding coarray type entry has a \DWATname{} attribute whose value is a null-terminated string containing the array type name. +\needlines{4} A coarray entry has one or more \DWTAGsubrangetype{} child entries, one for each codimension. It also has a \DWATtype{} attribute describing the type of each element of the coarray. @@ -775,6 +777,7 @@ in the following discussion, statements about \addtoindex{C++} classes may be understood to apply to \addtoindex{C++} structures as well.} +\needlines{6} \subsection{Structure, Union and Class Type Entries} \label{chap:structureunionandclasstypeentries} Structure, union, and class types are represented by debugging @@ -1209,6 +1212,26 @@ of storage needed to hold the value of the data member. see Appendix \refersec{app:pascalexample} and \refersec{app:ccppbitfieldexamples}.} +\bb +\subsection{Member Variable Entries} +\label{chap:membervariableentries} + +A member variable (\doublequote{static data member} in +\addtoindex{C++}) is represented by a +debugging information entry with the tag \DWTAGvariable. + +The member variable entry +may contain the same attributes and follows the same rules +as non-member global variable entries +(see Section \refersec{chap:dataobjectentries}). + +A member variable entry may have a +\hyperlink{chap:DWATaccessibilityattribute}{\DWATaccessibilityNAME} +\addtoindexx{accessibility attribute} +attribute. If no accessibility attribute is present, private +access is assumed for an entry of a class and public access +is assumed for an entry of a structure, union or interface. +\eb \subsection{Member Function Entries} \label{chap:memberfunctionentries} -- 2.17.1