public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/35880]  New: GNAT (GCC) Ada does not generate symbolic debug for shared memory
@ 2008-04-09  2:55 knoxj at att dot net
  2008-04-09  2:59 ` [Bug ada/35880] " knoxj at att dot net
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: knoxj at att dot net @ 2008-04-09  2:55 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug ada/35880] GNAT (GCC) Ada does not generate symbolic debug for shared memory
  2008-04-09  2:55 [Bug ada/35880] New: GNAT (GCC) Ada does not generate symbolic debug for shared memory knoxj at att dot net
@ 2008-04-09  2:59 ` knoxj at att dot net
  2008-04-09  3:01 ` knoxj at att dot net
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: knoxj at att dot net @ 2008-04-09  2:59 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug ada/35880] GNAT (GCC) Ada does not generate symbolic debug for shared memory
  2008-04-09  2:55 [Bug ada/35880] New: GNAT (GCC) Ada does not generate symbolic debug for shared memory knoxj at att dot net
  2008-04-09  2:59 ` [Bug ada/35880] " knoxj at att dot net
@ 2008-04-09  3:01 ` knoxj at att dot net
  2008-04-09  6:46 ` charlet at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: knoxj at att dot net @ 2008-04-09  3:01 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug ada/35880] GNAT (GCC) Ada does not generate symbolic debug for shared memory
  2008-04-09  2:55 [Bug ada/35880] New: GNAT (GCC) Ada does not generate symbolic debug for shared memory knoxj at att dot net
  2008-04-09  2:59 ` [Bug ada/35880] " knoxj at att dot net
  2008-04-09  3:01 ` knoxj at att dot net
@ 2008-04-09  6:46 ` charlet at gcc dot gnu dot org
  2008-04-09 15:20 ` knoxj at att dot net
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: charlet at gcc dot gnu dot org @ 2008-04-09  6:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from charlet at gcc dot gnu dot org  2008-04-09 06:45 -------
missing debug info is never really major, since there are always work arounds
(like print statements).

Note that there is close to zero chance that someone will look into your .bz2
file,
let alone your README. Instructions (and test case simplification) should be
part
of the submission of a PR if you want someone to look at it.

Arno


-- 

charlet at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |normal
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35880


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug ada/35880] GNAT (GCC) Ada does not generate symbolic debug for shared memory
  2008-04-09  2:55 [Bug ada/35880] New: GNAT (GCC) Ada does not generate symbolic debug for shared memory knoxj at att dot net
                   ` (2 preceding siblings ...)
  2008-04-09  6:46 ` charlet at gcc dot gnu dot org
@ 2008-04-09 15:20 ` knoxj at att dot net
  2008-04-09 15:26 ` charlet at adacore dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: knoxj at att dot net @ 2008-04-09 15:20 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug ada/35880] GNAT (GCC) Ada does not generate symbolic debug for shared memory
  2008-04-09  2:55 [Bug ada/35880] New: GNAT (GCC) Ada does not generate symbolic debug for shared memory knoxj at att dot net
                   ` (3 preceding siblings ...)
  2008-04-09 15:20 ` knoxj at att dot net
@ 2008-04-09 15:26 ` charlet at adacore dot com
  2008-04-09 16:19 ` knoxj at att dot net
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: charlet at adacore dot com @ 2008-04-09 15:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from charlet at adacore dot com  2008-04-09 15:25 -------
Subject: Re:  GNAT (GCC) Ada does not generate symbolic debug for shared memory

> 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.

Note that the GCC project is based on volunteers, so your PR may never
get the high priority attention that you apparently require.

For such critical usage, you may consider getting support for your compiler
(or get familiar with the compiler to investigate this issue yourself).

> 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.

Having a tar file for sources is certainly fine. Having all the instructions
and explanation inside a README in a tarball is an unnecessary indirection
which can only delay review of your PR.

Arno


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35880


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug ada/35880] GNAT (GCC) Ada does not generate symbolic debug for shared memory
  2008-04-09  2:55 [Bug ada/35880] New: GNAT (GCC) Ada does not generate symbolic debug for shared memory knoxj at att dot net
                   ` (4 preceding siblings ...)
  2008-04-09 15:26 ` charlet at adacore dot com
@ 2008-04-09 16:19 ` knoxj at att dot net
  2008-04-10  6:22 ` charlet at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: knoxj at att dot net @ 2008-04-09 16:19 UTC (permalink / raw)
  To: gcc-bugs



------- 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 on    2.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 on    2.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 on    2.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 on    2.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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug ada/35880] GNAT (GCC) Ada does not generate symbolic debug for shared memory
  2008-04-09  2:55 [Bug ada/35880] New: GNAT (GCC) Ada does not generate symbolic debug for shared memory knoxj at att dot net
                   ` (5 preceding siblings ...)
  2008-04-09 16:19 ` knoxj at att dot net
@ 2008-04-10  6:22 ` charlet at gcc dot gnu dot org
  2008-04-14 20:05 ` [Bug ada/35880] GNAT does not generate debugging information on imported entities sam at gcc dot gnu dot org
  2008-04-15 13:32 ` knoxj at att dot net
  8 siblings, 0 replies; 10+ messages in thread
From: charlet at gcc dot gnu dot org @ 2008-04-10  6:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from charlet at gcc dot gnu dot org  2008-04-10 06:21 -------
reopening


-- 

charlet at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-04-10 06:21:40
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35880


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug ada/35880] GNAT does not generate debugging information on imported entities
  2008-04-09  2:55 [Bug ada/35880] New: GNAT (GCC) Ada does not generate symbolic debug for shared memory knoxj at att dot net
                   ` (6 preceding siblings ...)
  2008-04-10  6:22 ` charlet at gcc dot gnu dot org
@ 2008-04-14 20:05 ` sam at gcc dot gnu dot org
  2008-04-15 13:32 ` knoxj at att dot net
  8 siblings, 0 replies; 10+ messages in thread
From: sam at gcc dot gnu dot org @ 2008-04-14 20:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from sam at gcc dot gnu dot org  2008-04-14 20:04 -------
Well, as far as I can tell, the bug doesn't have anything to do with shared
memory. It's just that GNAT does not emit any information for imported
entities, as demonstrated in the following example:

package P is
   Foobar : Integer;
   pragma Import (C, Foobar);
end P;

% gcc -g -S -o - p.ads | grep -i foobar
[no output]

Removing the "pragma Import" will show that debugging information, including
type-related information, is generated.

GNAT should IMO be able to do a better job here and store the information for
the symbols it imports if the debugging format supports it. Changing the bug
title and classifying as an enhancement request.


-- 

sam at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sam at gcc dot gnu dot org
           Severity|normal                      |enhancement
           Priority|P3                          |P5
   Last reconfirmed|2008-04-10 06:21:40         |2008-04-14 20:04:16
               date|                            |
            Summary|GNAT (GCC) Ada does not     |GNAT does not generate
                   |generate symbolic debug for |debugging information on
                   |shared memory               |imported entities


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35880


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug ada/35880] GNAT does not generate debugging information on imported entities
  2008-04-09  2:55 [Bug ada/35880] New: GNAT (GCC) Ada does not generate symbolic debug for shared memory knoxj at att dot net
                   ` (7 preceding siblings ...)
  2008-04-14 20:05 ` [Bug ada/35880] GNAT does not generate debugging information on imported entities sam at gcc dot gnu dot org
@ 2008-04-15 13:32 ` knoxj at att dot net
  8 siblings, 0 replies; 10+ messages in thread
From: knoxj at att dot net @ 2008-04-15 13:32 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-04-15 13:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-09  2:55 [Bug ada/35880] New: GNAT (GCC) Ada does not generate symbolic debug for shared memory knoxj at att dot net
2008-04-09  2:59 ` [Bug ada/35880] " knoxj at att dot net
2008-04-09  3:01 ` knoxj at att dot net
2008-04-09  6:46 ` charlet at gcc dot gnu dot org
2008-04-09 15:20 ` knoxj at att dot net
2008-04-09 15:26 ` charlet at adacore dot com
2008-04-09 16:19 ` knoxj at att dot net
2008-04-10  6:22 ` charlet at gcc dot gnu dot org
2008-04-14 20:05 ` [Bug ada/35880] GNAT does not generate debugging information on imported entities sam at gcc dot gnu dot org
2008-04-15 13:32 ` knoxj at att dot net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).