Bug 4083 - FEAT: libunwind-using-elfutils for symbols resolving
Summary: FEAT: libunwind-using-elfutils for symbols resolving
Status: ASSIGNED
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Jan Kratochvil
URL:
Keywords:
Depends on:
Blocks: 3076 3917 4059
  Show dependency treegraph
 
Reported: 2007-02-20 22:32 UTC by Mike Cvet
Modified: 2007-03-06 23:31 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
Test program. (1.19 KB, application/octet-stream)
2007-02-20 22:34 UTC, Mike Cvet
Details
gcc -g -S stepper.c (1.58 KB, application/octet-stream)
2007-02-20 22:35 UTC, Mike Cvet
Details
Implementation (v2). (10.62 KB, patch)
2007-03-04 15:43 UTC, Jan Kratochvil
Details | Diff
Implementation (v4). (10.83 KB, patch)
2007-03-06 23:31 UTC, Jan Kratochvil
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Cvet 2007-02-20 22:32:57 UTC
Taken in part from #4060:

Sometimes when stepping into new functions on i386, the frame being stepped 
from may dissapear during the first instruction of that stack frame.

The frame then reappears on subsequent steps.

I'll attach the source of a test program and its assembly.
Comment 1 Mike Cvet 2007-02-20 22:34:59 UTC
Created attachment 1570 [details]
Test program.

When instruction stepping into jump(), foo() will dissapear on jump()'s first
instruction and then re-appear after more stepping.
Comment 2 Mike Cvet 2007-02-20 22:35:30 UTC
Created attachment 1571 [details]
gcc -g -S stepper.c
Comment 3 Mike Cvet 2007-02-22 16:27:13 UTC
Downstream:

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=229424
Comment 4 Jan Kratochvil 2007-02-25 12:33:28 UTC
Problem is that -fasynchronous-unwind-tables is not default on i?86 and so
.eh_frame is not present there. .eh_frame is the only unwind information
currently supported by libunwind.
GDB supports also .debug_frame (generated by -g) and so it handles the case
without problem.
libunwind supports heuristics for unwinding without .eh_frame in general cases
(function bodies) but it fails in the prologue as was reported here.

libunwind support for .debug_frame has been discussed at:
http://lists.gnu.org/archive/html/libunwind-devel/2007-02/msg00000.html

Considering this Bug as a tracker for libunwind based on elfutils unwinding method.
Comment 5 Jan Kratochvil 2007-03-04 15:43:10 UTC
Created attachment 1597 [details]
Implementation (v2).

Currently it passes the testsuite (tested on x86) with some exceptions below.
Performance looks as a bit lower but it was not investigated so far.
Code could be cleaned up a bit but some David Mosberger-Tang internal API
advices could be helpful.
Comment 6 Jan Kratochvil 2007-03-04 15:49:08 UTC
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230903
Bug 230903: FEAT: dwfl_module_addrname() should also return lowpc+highpc
results in this current libunwind-using-elfutils testsuite regression:

Backtrace does not match on level==7, want "_start+", got "_start"
FAILURE: detected 1 errors
FAIL: run-ptrace-stepper
Backtrace does not match on level==5, want "_start+", got "_start"
FAILURE: detected 1 errors
Backtrace does not match on level==5, want "_start+", got "_start"
FAILURE: detected 1 errors
Backtrace does not match on level==5, want "_start+", got "_start"
FAILURE: detected 1 errors
Backtrace does not match on level==5, want "_start+", got "_start"
FAILURE: detected 1 errors
XFAIL: run-ptrace-signull
Comment 7 Jan Kratochvil 2007-03-04 15:49:44 UTC
Implementation currently needs for VDSO symbols resolving a kernel workaround
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230850
Bug 230850: [kernel] /proc/PID/mem is not readable
implemented to elfutils; needed on kernel-xen-2.6.19-1.2898.2.3.fc7.i686.
Some unlisted libunwind-using-elfutils testsuite regressions apply otherwise.
Comment 8 Jan Kratochvil 2007-03-04 15:52:49 UTC
Implementation currently recommends to rather use an elfutils bugfix
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230793
Bug 230793: File descriptors leakage
Some unlisted libunwind-using-elfutils testsuite regressions apply otherwise
(the regressions may no longer be true as elfutils caching is now implemented).
Comment 9 Jan Kratochvil 2007-03-06 23:31:49 UTC
Created attachment 1599 [details]
Implementation (v4).

Tested/bugfixed now also on x86_64.
It should be usable with elfutils-0.126-1 (only
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230793 fix is
recommended).