Summary: | Valgrind is unable to handle debug info for files with split debug info that are prelinked afterwards | ||
---|---|---|---|
Product: | [Developer tools] valgrind | Reporter: | Arvid Norlander <anmaster> |
Component: | general | Assignee: | Julian Seward <jseward> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | tom |
Priority: | NOR | ||
Version: | 3.4 SVN | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
prelink-test.tar.gz
Handle split debuginfo when the main file then gets prelinked |
Description
Arvid Norlander
2009-02-28 18:29:37 UTC
Probably TomH can comment more on this. I'd guess it's something to do with needing to maintain different text_bias values for the main object and the debuginfo object. Created attachment 31764 [details]
Handle split debuginfo when the main file then gets prelinked
That is indeed the problem, yes. There is a great comment about the problem in readelf.c in fact:
// FIXME: update di->text_bias at this point?
// or can we assume the SVMAs in the debuginfo
// file (hence, the biases) are the same as
// established from the main file?
Also your essay in readdwarf.c entitled "Comment_Regarding_DWARF3_Text_Biasing" describing the massive kludge we are currently using to (partially) try and work round the problem.
This patch should fix things - it tracks the svma and bias values properly for the debug info and uses them as appropriate. That also allows the kludge to be removed.
I tried to test the patch (against the 3.4 branch) but I got failed hunks. $ wget http://bugsfiles.kde.org/attachment.cgi?id=31764 $ mv attachment.cgi\?id\=31764 prelink-patch.patch $ patch -p0 --dry-run < prelink-patch.patch patching file coregrind/m_debuginfo/readdwarf.c Hunk #7 succeeded at 3630 (offset 1 line). Hunk #8 succeeded at 3677 (offset 1 line). Hunk #9 succeeded at 3686 (offset 1 line). Hunk #10 succeeded at 3715 (offset 1 line). Hunk #11 succeeded at 3748 (offset 1 line). patching file coregrind/m_debuginfo/readelf.c patching file coregrind/m_debuginfo/readstabs.c Hunk #1 FAILED at 336. 1 out of 1 hunk FAILED -- saving rejects to file coregrind/m_debuginfo/readstabs.c.rej patching file coregrind/m_debuginfo/priv_storage.h Hunk #1 FAILED at 354. 1 out of 1 hunk FAILED -- saving rejects to file coregrind/m_debuginfo/priv_storage.h.rej patching file coregrind/m_debuginfo/readdwarf3.c Hunk #1 FAILED at 474. 1 out of 6 hunks FAILED -- saving rejects to file coregrind/m_debuginfo/readdwarf3.c.rej patching file coregrind/m_debuginfo/d3basics.c Using clean r9321. I guess the patch is against trunk or something. I would be happy to test the patch if I knew what to patch against. The 3.4 branch would be easiest to test against. The patch is against trunk, not the 3.4 branch. You need to checkout svn://svn.valgrind.org/valgrind/trunk and try it against that. The patch works for me. Used trunk revision 9324. Committed as r9329. |