<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Pavel,<div><br></div><div>I think the offending struct is XSAVE in RegisterContext_x86.h. I don't really know this code, would you mind having a look? It looks like you touched the alignment in the past and seems to know what this this is doing :-) </div><div><br></div><div><div><div>tree f8fc1af1c62b728260b6c950649c55f7aba513f6</div><div>parent 6857692687979d934e188d117eadc93f48d52a0c</div><div>author Pavel Labath <<a href="mailto:pavel@labath.sk">pavel@labath.sk</a>> Wed Sep 12 08:50:08 2018 +0000</div><div>committer Pavel Labath <<a href="mailto:pavel@labath.sk">pavel@labath.sk</a>> Wed Sep 12 08:50:08 2018 +0000</div><div><br></div><div>Reduce alignment on struct XSAVE, fixing a gcc warning</div><div><br></div><div>The warning is about heap-allocating a struct with bigger alignment</div><div>requirements than the standard heap allocator provides.</div><div><br></div><div>AFAICT, all uses of the XSAVE struct are already heap-allocated, so this</div><div>high alignment does not actually have any effect and removing it should</div><div>be NFC.</div><div><br></div><div>I have also done some digging in the commit history. This alignment</div><div>requirement was since the XSAVE struct was introduced in r180572 when</div><div>adding AVX register support for linux. It does not mention the alignment</div><div>specifically, so I am guessing this was just put there because the</div><div>corresponging XSAVE cpu instruction requires its buffer to be 64-byte</div><div>aligned. However, LLDB will not be normally reading this struct via the</div><div>XSAVE instruction directly. Instead we will ask the kernel to copy the</div><div>buffer saved when suspeding the inferior. This should not require such</div><div>strict alignment (in fact, linux kernel will happily do this for any</div><div>alignment).</div><div><br></div><div>llvm-svn: 342029</div></div></div><div><br></div><div><br></div><div><br></div><div><br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 11, 2019 at 10:55 PM Pavel Labath <<a href="mailto:pavel@labath.sk">pavel@labath.sk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On 12/02/2019 01:30, Jonas Devlieghere via lldb-commits wrote:<br>
> Author: jdevlieghere<br>
> Date: Mon Feb 11 16:30:21 2019<br>
> New Revision: 353778<br>
> <br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=353778&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=353778&view=rev</a><br>
> Log:<br>
> Define _ENABLE_EXTENDED_ALIGNED_STORAGE on Windows.<br>
> <br>
> Apparently there are multiple places where MSVC complains about<br>
> instantiations with extended aligment. I think it's better to define<br>
> `_ENABLE_EXTENDED_ALIGNED_STORAGE` as suggested by the error message.<br>
> <br>
> I don't have access to a Windows machine so this is all speculative.<br>
> <br>
<br>
I think it would be worth investigating where is this large alignment <br>
coming from (my guess: something inside the RegisterContextDarwin <br>
structs). We've had a case in the past where we were heap-allocating a <br>
struct with a 64-byte alignment. MSVC would give a warning there, but <br>
gcc&clang would silently under-align the result.<br>
<br>
In that case, the large alignment was actually unneeded, so I fixed both <br>
issues by just lowering it. I suspect something similar may be possible <br>
here.<br>
<br>
pl<br>
</blockquote></div>