Bug 136536
Summary: | gdb cannot see static functions in code compiled at -O2 | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Dan Williams <dcbw> |
Component: | gdb | Assignee: | Elena Zannoni <ezannoni> |
Status: | CLOSED WONTFIX | QA Contact: | |
Severity: | high | Docs Contact: | |
Priority: | medium | ||
Version: | rawhide | CC: | jakub |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2006-08-14 19:11:21 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Dan Williams
2004-10-20 20:12:09 UTC
Jakub, what exactly does GCC do with static functions at -O2 and higher? From the manpage: -finline-functions If all calls to a given function are integrated, and the function is declared "static", then the function is normally not output as assembler code in its own right. Enabled at -O3. So this says its enabled at -O3, but for me it happens at -O2 with the above code using "gcc -o foo foo.c -O2". So, if -finline-functions is the issue, this is probably a gcc bug, either that: 1) manpage is wrong and -finline-functions is active at -O2, or 2) gcc is doing the wrong thing at -O2 At -O2, -finline-functions is not turned on. At -O2 starting with GCC 3.4 gcc also automatically inlines, but only static functions that are called once (and also removes altogether static functions that are never called). You can use noinline, always_inline or used attributes to override this behaviour. unfortunately known limmitation of gdb. We are trying to address this type of issues with Frysk. http://sources.rehdat.com/frysk |