Bug 338160 - implement display of thread local storage in gdbsrv
Summary: implement display of thread local storage in gdbsrv
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.9.0
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-09 22:09 UTC by Philippe Waroquiers
Modified: 2014-08-15 10:36 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Implement QGetTlsAddr in Valgrind gdbsrv (might need to touch 2 emtpy .exp files) (31.36 KB, text/plain)
2014-08-09 22:12 UTC, Philippe Waroquiers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Waroquiers 2014-08-09 22:09:21 UTC
Implement QGetTlsAddr query so that GDB+V gdbsrv can print __thread variables.

To implement QGetTlsAddr, gdbsrv has to know how to get the glibc dtv
address and the module id from the link_map.
These 2 things are dependent on the internals of glibc.
The dependency is mostly isolated in a few lines of arch dependent
code or in an external utility that used a hack + -ldl lib to find
the offset of the modid in the link_map structure.

Tested on x86/amd64/ppc64. Somewhat tested on ppc32 and arm64.
Untested and a few lines even not compiled on arm/mips32/mips64/s390x.

Feedback welcome
Comment 1 Philippe Waroquiers 2014-08-09 22:12:28 UTC
Created attachment 88193 [details]
Implement QGetTlsAddr in Valgrind gdbsrv (might need to touch 2 emtpy .exp files)

Implement QGetTlsAddr.
Note: you might have to do:
  touch gdbserver_tests/hgtls.stderr.exp
  touch gdbserver_tests/hgtls.stdoutB.exp
as these are empty files, and svn diff+patch
seems to have problems with empty files.
Comment 2 Philippe Waroquiers 2014-08-15 10:36:28 UTC
fixed in revision 14283