<div dir="ltr">> <span style="font-family:arial,sans-serif;font-size:13px">If it's not readily available, I guess I could just use the size of a pointer on the target?</span><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Or somewhat safer (but hackier), we could just continue to read 32 bits on little-endian machines and read pointer-sized ints on big-endian targets.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 3, 2014 at 8:31 AM, Steve Pucci <span dir="ltr"><<a href="mailto:spucci@google.com" target="_blank">spucci@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Richard,<div><br></div><div>I'm looking at this now. I'm having trouble finding the symbol name I need to query to get the modid size in DYLDRendezvous::GetThreadInfo(). Is there a document somewhere that describes those symbols (like _thread_db_link_map_l_tls_modid)? I'm not finding them with Google.</div>
<div><br></div><div>If it's not readily available, I guess I could just use the size of a pointer on the target?</div><div><br></div><div>Thanks again for your help here,<br></div><div> Steve</div></div><div class="HOEnZb">
<div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sat, Feb 1, 2014 at 4:57 PM, Steve Pucci <span dir="ltr"><<a href="mailto:spucci@google.com" target="_blank">spucci@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Great, thanks a lot, Richard. I'll make the change you suggest to the code I'm working on.<span><font color="#888888"><div><br></div><div> - Steve</div></font></span></div><div>
<div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Feb 1, 2014 at 11:57 AM, Richard Mitton <span dir="ltr"><<a href="mailto:richard@codersnotes.com" target="_blank">richard@codersnotes.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div bgcolor="#ffffff" text="#000000">
The definitive document is here: <a href="http://www.akkadia.org/drepper/tls.pdf" target="_blank">http://www.akkadia.org/drepper/tls.pdf</a><br>
<br>
I just had a look through and I guess it probably is a bug. Technically
the code in DLYDRendezvous::GetThreadInfo() should query not only the
location, but also the size of modid (using the same API), and then
later issue the appropriately-sized read.<br>
<br>
It's not really "wrong" for little-endian systems right now, unless you
have 4 billion modules loaded.<br>
<br>
<br>
Steve Pucci wrote:
<blockquote type="cite"><div><div>
<div dir="ltr">Hi all,
<div><br>
</div>
<div>I'm trying to determine if some code in DynamicLoaderPOSIXDYLD
is correct and I could use some confirmation:</div>
<div><br>
</div>
<div>The code in question reads the module id of a module as part of
finding the TLS block associated with that module, by determining its
location and then reading with a hardcoded 32-bit unsigned read. (The
code in question is
source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp, in
DynamicLoaderPOSIXDYLD::GetThreadLocalData).</div>
<div><br>
</div>
<div>I've read <a href="http://dev.gentoo.org/%7Edberkholz/articles/toolchain/tls.pdf" target="_blank">http://dev.gentoo.org/~dberkholz/articles/toolchain/tls.pdf</a>
, which describes a number of architectures and in all cases the value
seems to be either size_t or "unsigned long int". Thus the code
appears to be wrong in at least some cases, in that it should be
reading 64 bits when debugging 64-bit runtimes. The code presumably
works today for 64-bit LSB (little-endian) systems (which is most of
the 64-bit Linuxes) because it's reading the right 32-bits out of the
64-bit location.</div>
<div><br>
But I'm not 100% sure, because</div>
<div>* I'm not sure that the referenced pdf is definitive</div>
<div>* I don't have an MSB 64-bit system to test on to verify that
it's a bug.</div>
<div><br>
</div>
<div>Can anyone with any familiarity with this issue comment on this?</div>
<div><br>
</div>
<div>Thanks,</div>
<div> Steve</div>
</div>
</div></div><pre><hr width="90%" size="4">
_______________________________________________
lldb-dev mailing list
<a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a>
</pre>
</blockquote>
</div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>