<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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><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;}
@font-face
{font-family:"Calibri Light";
panose-1:2 15 3 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";
mso-fareast-language:EN-IN;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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-IN" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Below is a snippet of the dwarf info that we generate,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New"">0x00000057: DW_TAG_variable<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New""> DW_AT_name ("__gbloffset__")<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New""> DW_AT_type (0x000001e5 "int")<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New""> DW_AT_external (true)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New""> DW_AT_decl_file ("…")<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New""> DW_AT_decl_line (8)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New""> DW_AT_location (DW_OP_addr 0) // pre linkage<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New""> DW_AT_linkage_name ("_gblsection__")<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New""> DW_AT_endianity (DW_END_big)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New"">0x00000170: DW_TAG_variable<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New""> DW_AT_name ("VAR1")<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New""> DW_AT_type (0x0000010b "fixed.dec.display.72")<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New""> DW_AT_decl_file ("…")<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New""> DW_AT_decl_line (10)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New""> DW_AT_location (DW_OP_addr 0x0, DW_OP_call4 0x57, DW_OP_deref_size, 4,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New";color:red">DW_OP_dup, DW_OP_constu 0xff, DW_OP_lit0, DW_OP_shl, DW_OP_and, DW_OP_lit24, DW_OP_shl, DW_OP_swap, DW_OP_dup, DW_OP_constu 0xff, DW_OP_lit8, DW_OP_shl, DW_OP_and, DW_OP_lit8,
DW_OP_shl, DW_OP_swap, DW_OP_dup, DW_OP_constu 0xff, DW_OP_lit16, DW_OP_shl, DW_OP_and, DW_OP_lit8, DW_OP_shr, DW_OP_swap, DW_OP_constu 0xff, DW_OP_lit24, DW_OP_shl, DW_OP_and, DW_OP_lit24, DW_OP_shr, DW_OP_swap, DW_OP_or, DW_OP_or, DW_OP_or</span><span style="font-size:12.0pt;font-family:"Courier New"">,
DW_OP_plus)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New""> DW_AT_linkage_name ("VAR1")</span><span style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">In above code for location calculation of “VAR1” we change the endianity of “__</span><span style="font-size:12.0pt;font-family:"Courier New"">gbloffset__</span><span style="mso-fareast-language:EN-US">”
var, it is 32 bit value on 64-bit machine.<o:p></o:p></span></p>
<pre><span style="font-size:12.0pt;font-family:"Calibri Light",sans-serif">In above case </span><span style="font-size:12.0pt">DW_OP_byte_swap </span><span style="font-size:12.0pt;font-family:"Calibri Light",sans-serif">will replace near about 38 operations(for 32 bit value), that’s 38-bytes per usage savings on mem footprint and at runtime as well</span><span style="font-size:12.0pt">. </span><span style="font-size:12.0pt;font-family:"Calibri Light",sans-serif">I do not have any profiling data.</span><span style="font-size:12.0pt"><o:p></o:p></span></pre>
<pre><o:p> </o:p></pre>
<pre><span style="font-size:12.0pt;font-family:"Calibri Light",sans-serif">The use case for DW_OP_byte_swap is, for typed entry we know the size, for raw data, dwarf operator will consider the generic type and pop the top of the stack, byte swap it and push the data back on the stack.<o:p></o:p></span></pre>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="color:#2F5597;mso-fareast-language:FR-BE"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597;mso-fareast-language:FR-BE">Chirag Patel</span></b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597;mso-fareast-language:FR-BE"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12.0pt;color:#2F5597;mso-fareast-language:FR-BE">Software Engineer | Raincode Labs India
<o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597;mso-fareast-language:FR-BE">Tel</span></b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597;mso-fareast-language:FR-BE">: (+91) 080 41159811<o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597;mso-fareast-language:FR-BE">Mob</span></b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597;mso-fareast-language:FR-BE">: (+91) 9049336744<o:p></o:p></span></p>
<p class="MsoNormal"><u><span lang="EN-US" style="font-size:12.0pt;color:blue;mso-fareast-language:FR-BE"><a href="http://www.raincodelabs.com/"><span style="color:#0563C1">www.raincodelabs.com</span></a><o:p></o:p></span></u></p>
<p class="MsoNormal"><a href="https://in.linkedin.com/in/chirag-patel-"><span style="font-size:10.0pt;color:#0563C1;mso-fareast-language:FR-BE;text-decoration:none"><img border="0" width="180" height="60" style="width:1.875in;height:.625in" id="Picture_x0020_1" src="cid:image001.png@01D5AA92.5E545570" alt="linkedin-button"></span></a><span style="font-size:10.0pt;color:#2F5597;mso-fareast-language:FR-BE"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> David Blaikie <dblaikie@gmail.com>
<br>
<b>Sent:</b> 03 December 2019 21:31<br>
<b>To:</b> Chirag Patel <Chirag@raincode.com><br>
<b>Cc:</b> Adrian Prantl <aprantl@apple.com>; Paul Robinson <paul.robinson@sony.com>; Jonas Devlieghere <jdevlieghere@apple.com>; llvm-dev@lists.llvm.org<br>
<b>Subject:</b> Re: [llvm-dev] addition of vendor dwarf operator extension.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Does this have a significant impact on total DWARF size or performance that you've observed/have data about?<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Tue, Dec 3, 2019 at 12:06 AM Chirag Patel <<a href="mailto:Chirag@raincode.com">Chirag@raincode.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hello,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Thanks for prompt reply.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Motivation,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">In case of debugging of bi-endian dwarf and value known at runtime some of the raw values needs to be byte swapped to change the endianity. We have a llvm based compiler which generates
such dwarf, TAG_variable marked as big endian and debugging on little endian host using lldb. The listed operator on dwarf issues does that, one operator instead of list of operators.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Proposal,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Addition of listed dwarf operator as vender extension in llvm/lldb till it gets released.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Regards, <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-US" style="color:#2F5597"> </span></b><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597">Chirag Patel</span></b><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:12.0pt;color:#2F5597">Software Engineer | Raincode Labs India
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597">Tel</span></b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597">: (+91) 080 41159811</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597">Mob</span></b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597">: (+91) 9049336744</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><u><span lang="EN-US" style="font-size:12.0pt;color:blue"><a href="http://www.raincodelabs.com/" target="_blank"><span style="color:#0563C1">www.raincodelabs.com</span></a></span></u><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><a href="https://in.linkedin.com/in/chirag-patel-" target="_blank"><span style="font-size:10.0pt;color:#0563C1;text-decoration:none"><img border="0" width="180" height="60" style="width:1.875in;height:.625in" id="gmail-m_917325676240102948Picture_x0020_1" src="cid:image002.png@01D5AA92.5E545570" alt="linkedin-button"></span></a><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>>
<br>
<b>Sent:</b> 02 December 2019 19:51<br>
<b>To:</b> Chirag Patel <<a href="mailto:Chirag@raincode.com" target="_blank">Chirag@raincode.com</a>>; Adrian Prantl <<a href="mailto:aprantl@apple.com" target="_blank">aprantl@apple.com</a>>; Paul Robinson <<a href="mailto:paul.robinson@sony.com" target="_blank">paul.robinson@sony.com</a>>;
Jonas Devlieghere <<a href="mailto:jdevlieghere@apple.com" target="_blank">jdevlieghere@apple.com</a>><br>
<b>Cc:</b> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<b>Subject:</b> Re: [llvm-dev] addition of vendor dwarf operator extension.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">There are some vendor extensions already in LLVM/LLDB, though I guess the main question would be: what's the motivation?<o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On Mon, Dec 2, 2019 at 3:14 AM Chirag Patel via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hello all,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">There is one enhancement request open for dwarfv5,
<a href="http://dwarfstd.org/ShowIssue.php?issue=191107.1" target="_blank">http://dwarfstd.org/ShowIssue.php?issue=191107.1</a><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">The request is for addition of dwarf expression operator to swap the top of the dwarf stack, the response seems positive but it may take some time till v6.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I like to add that operator as vendor extension but I am not sure how to go about it for llvm/lldb. Currently I am using it as vendor specific extension on our local fork.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Does adding it as vender specific extension seems like a good idea? If yes please provide me the details about adding specific vendor. <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Regards,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-US" style="color:#2F5597"> </span></b><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597">Chirag Patel</span></b><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:12.0pt;color:#2F5597">Software Engineer | Raincode Labs India
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597">Tel</span></b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597">: (+91) 080 41159811</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597">Mob</span></b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597">: (+91) 9049336744</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><u><span lang="EN-US" style="font-size:12.0pt;color:blue"><a href="http://www.raincodelabs.com/" target="_blank"><span style="color:#0563C1">www.raincodelabs.com</span></a></span></u><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><a href="https://in.linkedin.com/in/chirag-patel-" target="_blank"><span style="font-size:10.0pt;color:#0563C1;text-decoration:none"><img border="0" width="180" height="60" style="width:1.875in;height:.625in" id="gmail-m_917325676240102948gmail-m_8019694081635403889Picture_x0020_1" src="cid:image003.png@01D5AA92.5E545570" alt="linkedin-button"></span></a><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</body>
</html>