Bug 22671
| Summary: | gdb does not find locally scoped symbols | ||
|---|---|---|---|
| Product: | [Retired] Red Hat Linux | Reporter: | Rick Delashmit <wyrd> |
| Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
| Status: | CLOSED DUPLICATE | QA Contact: | Aaron Brown <abrown> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.0 | ||
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | i386 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2000-12-26 23:07:00 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: | |||
I ran this test case using 'kgcc -x c++ -o a a.cxx' (kgcc as shipped with RH7, egcs-2.91.66) to compile it, and it worked correctly, so this appears likely to be a bug with the debug info output by the gcc 2.96 package, rather than with gdb. jakub, assigning to you... I know I did so a couple of months ago with a very similar bug (probably duplicate), but you know the gcc bu g numbers better than me. |
When debugging a c++ program, gdb is unable to find symbols in scopes more local than function level. Source and directions for repeating the problem follow. --- source file a.cxx class Test { public: void Init() { a = 0; } public: int a; }; int main(int argc, char* argv[]) { { TestClass t; t.Init(); } return 0; } --- end source file a.cxx compiled with 'g++ -g -o a a.cxx' debugged with 'gdb a' in gdb: break TestClass::Init r (breaks in TestClass::Init()) frame 1 p t t should be in scope here, as we are at the t.Init() line. Instead we get a 'No symbol "t" in current context.' message. I tested this on an RH6.2 system and it worked properly.