<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-ligatures:standardcontextual;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:56.7pt 42.5pt 56.7pt 85.05pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">A “location description [that] is a register operation” is the language in DWARF v3; in later versions, it is “a simple register location description.” This means something like DW_OP_reg5, which is allowed in a location description but
 not in a DWARF expression.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Form DW_FORM_data4, value 0, would be interpreted as a location list reference. It is not by itself an address or a register location description.<o:p></o:p></p>
<p class="MsoNormal">--paulr<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="mso-ligatures:none">From:</span></b><span style="mso-ligatures:none"> Dwarf-discuss <dwarf-discuss-bounces+paul.robinson=sony.com@lists.dwarfstd.org>
<b>On Behalf Of </b>Vsevolod Alekseyev via Dwarf-discuss<br>
<b>Sent:</b> Monday, September 18, 2023 10:08 AM<br>
<b>To:</b> dwarf-discuss@lists.dwarfstd.org<br>
<b>Subject:</b> [Dwarf-discuss] DW_AT_frame_base<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Please help me interpret the DWARF spec regarding the DW_AT_frame_base. Quoted by spec v3, section 3.5.5, but similar wording in v4 and v5:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:11.5pt;color:black">“A subroutine or entry point entry may also have a
</span><span style="font-size:11.5pt;color:blue">DW_AT_frame_base </span><span style="font-size:11.5pt;color:black">attribute, whose value is a location description that computes the “frame base” for the subroutine or entry point. If the location description
 is a register operation, the given register contains the frame base address. If the location description is a DWARF expression, the result of evaluating that expression is the frame base address. Finally, for a location list, this interpretation applies to
 each location expression contained in the list of location list entries.”<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.5pt;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.5pt;color:black">So what does “location description that is a register operation” mean here? Since the option of a DWARF expression block is covered by the second option, that rather suggests to me that “register
 operation” is not a DWARF operation. I mean, the wording “if A is X, then Y. If A is P, then Q” usually means that P is distinct from X, right?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.5pt;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.5pt;color:black">On a more practical note, I’m currently staring at a crash report with a DWARF attribute parsing failure. DWARF v3 Linux ELF binary, produced by NASM. DW_AT_frame_base, form DW_FORM_data4, value
 0. The code assumes it’s a loclist pointer, but the binary doesn’t contain a loclist section.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.5pt;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.5pt;color:black">Zero as a loclist pointer in a v3 binary could make sense. As a “register operation” – I’m not sure. Could be a compiler quirk, but I’m admitting the possibility that I’m misreading something.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.5pt;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.5pt;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>