<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)"><style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@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:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
color:black;}
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:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New",serif;
color:black;}
span.EmailStyle17
{mso-style-type:personal;
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:Consolas;
color:black;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
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 bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>A note on this – we’re using this internally for Hexagon, and it works – at least for the fairly simple calls I’ve tried </span><span style='font-family:Wingdings;color:#1F497D'>J</span><span style='color:#1F497D'>.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='color:windowtext'>From:</span></b><span style='color:windowtext'> lldb-dev-bounces@cs.uiuc.edu [mailto:lldb-dev-bounces@cs.uiuc.edu] <b>On Behalf Of </b>Colin Riley<br><b>Sent:</b> Tuesday, March 31, 2015 10:46 AM<br><b>To:</b> Sean Callanan<br><b>Cc:</b> lldb-dev@cs.uiuc.edu<br><b>Subject:</b> Re: [lldb-dev] Expressions on baremetal target<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>Hey Sean,<br><br>Yeah, it's a nice feature - even if it only works with basic types as you noticed. I'll look to fix up the concerns you've identified. We're working on a few other hexagon-related patches to put into review, so I'll add this one to the list. We'll add you as a reviewer when it happens - thanks!<br><br>Colin<span style='font-size:12.0pt'><o:p></o:p></span></p><div><p class=MsoNormal>On 31/03/2015 16:02, Sean Callanan wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal>Colin,<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>looking at that patch, it looks like it has some great ideas!<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I have a few concerns:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal> (a) it looks like it is not 64-bit clean, it assumes that everything it works with is 4 bytes wide;<o:p></o:p></p></div><div><p class=MsoNormal> (b) it's got some assertions where I'd prefer proper error handling;<o:p></o:p></p></div><div><p class=MsoNormal> (c) it relies on the PrepareTrivialCall infrastructure which only handles simple argument types; and<o:p></o:p></p></div><div><p class=MsoNormal> (d) while it tries hard to ensure that strings are exported into the target's memory, it doesn't have any provisions for moving other data that the expression allocated.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>While I'd defer to Jim Ingham for comment on the thread plan aspect, I think the interpreter side looks like it has potential. Also that part might still apply. I'm fine with ironing out (c) and (d) in tree, working with the LLVM folks to get better solutions, but (a) and (b) and a style nit here and there would currently block integration from my point of view. Hopefully you agree that those are the easy bits to fix.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>If you can resurrect this patch against recent ToT, I'm happy to be a reviewer.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Sean<o:p></o:p></p></div><div><p class=MsoNormal><br>Sent from my iPad<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><br>On Mar 31, 2015, at 4:41 AM, Colin Riley <<a href="mailto:colin@codeplay.com">colin@codeplay.com</a>> wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal style='margin-bottom:12.0pt'>Hi Bhushan<br><br>We ran into this problem whilst doing the Hexagon DSP support in LLDB. <br><br>This review was up (<a href="http://reviews.llvm.org/D4672">http://reviews.llvm.org/D4672</a>) but is now stale without reviewers. Basically we added the ability to the IR interpreter to call functions on the target using a threadplan which manipulated the stack and registers to call functions and capture any return values, which works well on bare metal without ability to jit.<br><br>Maybe the patches can be of help to you. I doubt they would apply cleanly now given the length of time since it was uploaded. It's a valuable feature, but priorities on the list were elsewhere :)<br><br>Colin<br><br><o:p></o:p></p><div><p class=MsoNormal>On 31/03/2015 12:30, Bhushan Attarde wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal>Hi,<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>We are debugging a baremetal application using LLDB which is connected to a remote target (supporting GDB remote protocol). <o:p></o:p></p><p class=MsoNormal>We are able to execute expressions involving global and frame variables such as:<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><span style='font-family:"Courier New",serif'>(lldb) expr var+4</span><o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>However, LLDB is unable to execute expressions involving function calls.<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><span style='font-family:"Courier New",serif'>(lldb) expr (int) bar(1,2)</span><o:p></o:p></p><p class=MsoNormal><span style='font-family:"Courier New",serif'>error: Can't run the expression locally: Interpreter doesn't handle one of the expression's opcodes</span><o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>Function bar is defined as <span style='font-family:"Courier New",serif'>int bar(int, int).</span><o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>The expression execution_policy is set to <span style='font-family:"Courier New",serif'>eExecutionPolicyNever</span> as <span style='font-family:"Courier New",serif'>CanJIT()</span> returns false for baremetal applications.<o:p></o:p></p><p class=MsoNormal>This is because JIT is disabled for static dynamic loader targets.<o:p></o:p></p><p class=MsoNormal>The<span style='font-family:"Courier New",serif'> IRInterpreter::CanInterpret</span> returns false as it fails to interpret call instruction (call to 'bar' is not an intrinsic). <o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>Could you please help us on this?<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>-Regards<o:p></o:p></p><p class=MsoNormal>Bhushan<o:p></o:p></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'><br><br><br><o:p></o:p></span></p><pre>_______________________________________________<o:p></o:p></pre><pre>lldb-dev mailing list<o:p></o:p></pre><pre><a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><o:p></o:p></pre><pre><a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><o:p></o:p></pre></blockquote><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'><br><br><o:p></o:p></span></p><pre>-- <o:p></o:p></pre><pre>- Colin Riley<o:p></o:p></pre><pre>Games Technology Director<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>Codeplay Software Ltd<o:p></o:p></pre><pre>45 York Place, Edinburgh, EH1 3HP<o:p></o:p></pre><pre>Tel: 0131 466 0503<o:p></o:p></pre><pre>Fax: 0131 557 6600<o:p></o:p></pre><pre>Website: <a href="http://www.codeplay.com">http://www.codeplay.com</a><o:p></o:p></pre><pre>Twitter: <a href="https://twitter.com/codeplaysoft">https://twitter.com/codeplaysoft</a><o:p></o:p></pre><pre><o:p> </o:p></pre><pre>This email and any attachments may contain confidential and /or privileged information and is for use by the addressee only. If you are not the intended recipient, please notify Codeplay Software Ltd immediately and delete the message from your computer. You may not copy or forward it,or use or disclose its contents to any other person. Any views or other information in this message which do not relate to our business are not authorized by Codeplay software Ltd, nor does this message form part of any contract unless so stated.<o:p></o:p></pre><pre>As internet communications are capable of data corruption Codeplay Software Ltd does not accept any responsibility for any changes made to this message after it was sent. Please note that Codeplay Software Ltd does not accept any liability or responsibility for viruses and it is your responsibility to scan any attachments.<o:p></o:p></pre><pre>Company registered in England and Wales, number: 04567874<o:p></o:p></pre><pre>Registered office: 81 Linkfield Street, Redhill RH1 6BY <o:p></o:p></pre></div></blockquote><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'>_______________________________________________<br>lldb-dev mailing list<br><a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><o:p></o:p></span></p></div></blockquote></blockquote><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'><br><br><o:p></o:p></span></p><pre>-- <o:p></o:p></pre><pre>- Colin Riley<o:p></o:p></pre><pre>Games Technology Director<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>Codeplay Software Ltd<o:p></o:p></pre><pre>45 York Place, Edinburgh, EH1 3HP<o:p></o:p></pre><pre>Tel: 0131 466 0503<o:p></o:p></pre><pre>Fax: 0131 557 6600<o:p></o:p></pre><pre>Website: <a href="http://www.codeplay.com">http://www.codeplay.com</a><o:p></o:p></pre><pre>Twitter: <a href="https://twitter.com/codeplaysoft">https://twitter.com/codeplaysoft</a><o:p></o:p></pre><pre><o:p> </o:p></pre><pre>This email and any attachments may contain confidential and /or privileged information and is for use by the addressee only. If you are not the intended recipient, please notify Codeplay Software Ltd immediately and delete the message from your computer. You may not copy or forward it,or use or disclose its contents to any other person. Any views or other information in this message which do not relate to our business are not authorized by Codeplay software Ltd, nor does this message form part of any contract unless so stated.<o:p></o:p></pre><pre>As internet communications are capable of data corruption Codeplay Software Ltd does not accept any responsibility for any changes made to this message after it was sent. Please note that Codeplay Software Ltd does not accept any liability or responsibility for viruses and it is your responsibility to scan any attachments.<o:p></o:p></pre><pre>Company registered in England and Wales, number: 04567874<o:p></o:p></pre><pre>Registered office: 81 Linkfield Street, Redhill RH1 6BY <o:p></o:p></pre></div></body></html>