[Bug ada/35880] New: GNAT (GCC) Ada does not generate symbolic debug for shared memory
GNAT (GCC) Ada does not generate symbolic debug for shared memory. 'gdb' says "No definition of "pacs_cp" in current context." comment "pragma IMPORT" staement and symbolic debug is present. complete details and step-by-step instructions in README. I have 'makefile' and short sample source to illustrate problem. -- Summary: GNAT (GCC) Ada does not generate symbolic debug for shared memory Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: major Priority: P3 Component: ada AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: knoxj at att dot net GCC build triplet: i386-redhat-linux GCC host triplet: i386-redhat-linux GCC target triplet: i386-redhat-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35880
[Bug ada/35880] GNAT (GCC) Ada does not generate symbolic debug for shared memory
--- Comment #1 from knoxj at att dot net 2008-04-09 02:59 --- Created an attachment (id=15451) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15451&action=view) README, makefile, test source files README has file list description and step-by-step instructions to cause bug. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35880
[Bug ada/35880] GNAT (GCC) Ada does not generate symbolic debug for shared memory
--- Comment #2 from knoxj at att dot net 2008-04-09 03:01 --- README in attachment has file list description and step-by-step instructions to reproduce bug. -- knoxj at att dot net changed: What|Removed |Added CC||knoxj at att dot net http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35880
[Bug ada/35880] GNAT (GCC) Ada does not generate symbolic debug for shared memory
--- Comment #4 from knoxj at att dot net 2008-04-09 15:19 --- Print statements work if you know what you want to look at. The application is an aircraft simulation by stimulating avionics black boxes. We use a debugger to examine state information while the simulation is running to try to determine problem causes. I spent 3 days condensing hundreds of thousands of source lines to the test case I submitted. I tried to provide a short test case to demonstrate the problem. I ended up with 14 files consisting of 2226 actual source lines. I thought I read in the submission guidelines that an attachment was acceptable in a case like this. If I should submit the file contents as a large file, please point me to a sample so I know how to format the various individual file contents. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35880
[Bug ada/35880] GNAT (GCC) Ada does not generate symbolic debug for shared memory
--- Comment #6 from knoxj at att dot net 2008-04-09 16:19 --- Thank you for your comments. This is my first free software bug report, so I'm still learning the ropes. I have been submitting commercial vendor bug reports for several decades, and old habits die hard. README file contents : The files listed below demonstrate the GNAT Ada compiler not generating 'gdb' debug information correctly for shared memory. 'gdb' says "No definition of "pacs_cp" in current context." NightView says "Identifier "pacs_cp" is not visible in the given context." Problem first found on 2.6.18.8-RedHawk-4.2.2-trace gdb Concurrent RedHawk Linux (6.3.0.0-1.63rh) gcc version 3.4.6 20060404 (Red Hat 3.4.6-3) Problem verified on2.6.15.4-RedHawk-4.1-debug gdb Concurrent RedHawk Linux (6.3.0.0-1.63rh) gcc version 3.4.4 20050721 (Red Hat 3.4.4-2) Problem verified on2.6.9-RedHawk-2.3.5-debug gdb 6.0 gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-49) Problem verified on2.6.9-42.0.3.EL (Red Hat EL WS 4 update 4) gdb Red Hat Linux (6.3.0.0-1.132.EL4rh) gcc version 3.4.6 20060404 (Red Hat 3.4.6-3) Problem verified on2.6.23.1-42.fc8 gdb Fedora (6.8-1.fc9) gcc version 4.3.0 20080326 (Red Hat 4.3.0-5) (GCC) === makefile - build rules ada_proclock.ads - Ada interface proclock.h - C interface proclock.c - C implementation f15_shm.ld - 'ld' commands for shared memory layout f15_shm.h- C interface f15_shm.c- C implementation f15_shm_tables.c - shared memory data tables nh_base_types.ads- hardware representation test_pacs_cp_package.ads - Ada data description testshm.adb - Ada test program pacs_cp.h - C data description testshmc.c - C test program === Follow the steps below to reproduce the problem : 1. make clean 2. make 3. gdb testshma 'tb main' 'r' 'n' 7 times to get to "Ada_Main_Program" 's' 'n' 4 times 'ptype pacs_cp' to get "No definition of "pacs_cp" in current context." 4. gdb testshmc 'tb main' 'r' 'n' 4 times 'ptype pacs_cp' to get type = volatile struct PACS_CP { short int word[8192]; } 5. edit test_pacs_cp_package.ads comment "pragma IMPORT" line 6. make 7. gdb testshma 'tb main' 'r' 'n' 7 times to get to "Ada_Main_Program" 's' 'n' 4 times 'ptype pacs_cp' to get type = record word: array (1 .. 8192) of nh_base_types.signed_half_word_type; end record -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35880
[Bug ada/35880] GNAT does not generate debugging information on imported entities
--- Comment #9 from knoxj at att dot net 2008-04-15 13:31 --- I was going to update my bug report when I noticed Sam's comments. I used "readelf -a -w test_pacs_cp_package.o" to try to see what was happening, and I saw that the compiler was throwing out any information about the Ada definintion. I would have expected the compiler to hang onto the Ada debug information, but use the IMPORT information for code generation. The linker would then resolve the IMPORT name, and the debugger could see the Ada description. I too realized that shared memory was a red herring, and the real problem was simply the IMPORT implementation. Sam's sample illustrates this much better than the source files I submitted. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35880