public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/23205] New: [C++] debug info omitted for global variables
@ 2005-08-02 18:43 dpatel at apple dot com
  2005-08-02 18:45 ` [Bug debug/23205] [C++] debug info omitted for global static const variables pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: dpatel at apple dot com @ 2005-08-02 18:43 UTC (permalink / raw)
  To: gcc-bugs

GCC does not emit debug info for variable 'j' in following example, when stabs debugging format is 
used.

const int j = 4;
int foo ()
{
        return j + 1;
}

int main()
{
        int i;
        i = foo();
        return i;
}

-- 
           Summary: [C++] debug info omitted for global variables
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dpatel at apple dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug debug/23205] [C++] debug info omitted for global static const variables
  2005-08-02 18:43 [Bug debug/23205] New: [C++] debug info omitted for global variables dpatel at apple dot com
@ 2005-08-02 18:45 ` pinskia at gcc dot gnu dot org
  2005-08-02 18:45 ` [Bug debug/23205] [C++] debug info omitted for global " pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-02 18:45 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[C++] debug info omitted for|[C++] debug info omitted for
                   |global variables            |global static const
                   |                            |variables


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


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

* [Bug debug/23205] [C++] debug info omitted for global const variables
  2005-08-02 18:43 [Bug debug/23205] New: [C++] debug info omitted for global variables dpatel at apple dot com
  2005-08-02 18:45 ` [Bug debug/23205] [C++] debug info omitted for global static const variables pinskia at gcc dot gnu dot org
@ 2005-08-02 18:45 ` pinskia at gcc dot gnu dot org
  2005-08-02 18:57 ` [Bug c++/23205] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-02 18:45 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[C++] debug info omitted for|[C++] debug info omitted for
                   |global static const         |global const variables
                   |variables                   |


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


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

* [Bug c++/23205] [4.0/4.1 Regression] [C++] debug info omitted for global const variables
  2005-08-02 18:43 [Bug debug/23205] New: [C++] debug info omitted for global variables dpatel at apple dot com
  2005-08-02 18:45 ` [Bug debug/23205] [C++] debug info omitted for global static const variables pinskia at gcc dot gnu dot org
  2005-08-02 18:45 ` [Bug debug/23205] [C++] debug info omitted for global " pinskia at gcc dot gnu dot org
@ 2005-08-02 18:57 ` pinskia at gcc dot gnu dot org
  2005-08-02 19:00 ` [Bug c++/23205] [4.0/4.1 Regression] [C++/unit-at-a-time] " dpatel at apple dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-02 18:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-02 18:57 -------
Confirmed, this is because we "inline" the value of j and then remove the variable but for some reason 
dwarf-2 emits debuging info.

This is unit-at-a-time problem as you can reproduce it on the 3.4 branch by adding -funit-at-a-time 
-O0 -gstabs+ and you will not get the debug info.

You know what is better is just move to dwarf-2 instead for ppc-darwin.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
           Severity|normal                      |minor
             Status|UNCONFIRMED                 |NEW
          Component|debug                       |c++
     Ever Confirmed|                            |1
           Keywords|                            |wrong-debug
   Last reconfirmed|0000-00-00 00:00:00         |2005-08-02 18:57:31
               date|                            |
            Summary|[C++] debug info omitted for|[4.0/4.1 Regression] [C++]
                   |global const variables      |debug info omitted for
                   |                            |global const variables
   Target Milestone|---                         |4.0.2


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


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

* [Bug c++/23205] [4.0/4.1 Regression] [C++/unit-at-a-time] debug info omitted for global const variables
  2005-08-02 18:43 [Bug debug/23205] New: [C++] debug info omitted for global variables dpatel at apple dot com
                   ` (2 preceding siblings ...)
  2005-08-02 18:57 ` [Bug c++/23205] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-08-02 19:00 ` dpatel at apple dot com
  2005-08-02 19:02 ` [Bug c++/23205] [4.0/4.1 Regression] [C++/unit-at-a-time] stabs " pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dpatel at apple dot com @ 2005-08-02 19:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dpatel at apple dot com  2005-08-02 19:00 -------
Subject: Re:  [4.0/4.1 Regression] [C++] debug info omitted for global const variables


On Aug 2, 2005, at 11:57 AM, pinskia at gcc dot gnu dot org wrote:

> You know what is better is just move to dwarf-2 instead for ppc- 
> darwin.

:).

"It works in DWARF mode" is not a good excuse to ignore stabs while  
making various changes in the compiler.




-- 


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


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

* [Bug c++/23205] [4.0/4.1 Regression] [C++/unit-at-a-time] stabs debug info omitted for global const variables
  2005-08-02 18:43 [Bug debug/23205] New: [C++] debug info omitted for global variables dpatel at apple dot com
                   ` (3 preceding siblings ...)
  2005-08-02 19:00 ` [Bug c++/23205] [4.0/4.1 Regression] [C++/unit-at-a-time] " dpatel at apple dot com
@ 2005-08-02 19:02 ` pinskia at gcc dot gnu dot org
  2005-08-13  0:33 ` wilson at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-02 19:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-02 19:02 -------
I forgot to mention this works just fine for dwarf-2 because we emit the debug info even though the 
variable is not emitted.

-- 


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


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

* [Bug c++/23205] [4.0/4.1 Regression] [C++/unit-at-a-time] stabs debug info omitted for global const variables
  2005-08-02 18:43 [Bug debug/23205] New: [C++] debug info omitted for global variables dpatel at apple dot com
                   ` (4 preceding siblings ...)
  2005-08-02 19:02 ` [Bug c++/23205] [4.0/4.1 Regression] [C++/unit-at-a-time] stabs " pinskia at gcc dot gnu dot org
@ 2005-08-13  0:33 ` wilson at gcc dot gnu dot org
  2005-08-17 20:44 ` tomas dot vanek at fbl dot cz
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: wilson at gcc dot gnu dot org @ 2005-08-13  0:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From wilson at gcc dot gnu dot org  2005-08-13 00:33 -------
The problem here is the DECL_RTL_SET_P tests in dbxout_global_decl and
dbxout_symbol.  Constants have a NULL DECL_RTL, and hence fail this test.  This
is OK, because we don't use the DECL_RTL when emitting debug info for a
constant.  However, everything else does need to have a valid DECL_RTL.  It
looks like deleting the redundant test in dbxout_global_decl and repositioning
the test after the check for constants in dbxout_symbol case VAR_DECL would work.

Writing and testing the patch is left as an exercise for the reader.

-- 


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


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

* [Bug c++/23205] [4.0/4.1 Regression] [C++/unit-at-a-time] stabs debug info omitted for global const variables
  2005-08-02 18:43 [Bug debug/23205] New: [C++] debug info omitted for global variables dpatel at apple dot com
                   ` (5 preceding siblings ...)
  2005-08-13  0:33 ` wilson at gcc dot gnu dot org
@ 2005-08-17 20:44 ` tomas dot vanek at fbl dot cz
  2005-08-17 21:08 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tomas dot vanek at fbl dot cz @ 2005-08-17 20:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tomas dot vanek at fbl dot cz  2005-08-17 20:35 -------
It seems the same bug is in generating stabs for any global variable too.
Very easy test code var.c :-)

int var;

gcc -S -gstabs var.c

generates
     .stabs  "var:G(0,1)",32,0,0,0

gcc -S -gstabs -funit-at-a-time var.c

generates only .comm or .skip and does no stabs for the variable.
Tested i386 gcc 4.0.0 and cross avr-gcc 4.0.1.
Still to be left as an exercise for the reader?

-- 


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


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

* [Bug c++/23205] [4.0/4.1 Regression] [C++/unit-at-a-time] stabs debug info omitted for global const variables
  2005-08-02 18:43 [Bug debug/23205] New: [C++] debug info omitted for global variables dpatel at apple dot com
                   ` (6 preceding siblings ...)
  2005-08-17 20:44 ` tomas dot vanek at fbl dot cz
@ 2005-08-17 21:08 ` pinskia at gcc dot gnu dot org
  2005-09-18  2:18 ` pinskia at gcc dot gnu dot org
  2005-09-27 15:58 ` mmitchel at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-17 21:08 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-17 21:06 -------
(In reply to comment #5)
> Still to be left as an exercise for the reader?

That is a different bug, see PR 23190.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tomas dot vanek at fbl dot
                   |                            |cz


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


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

* [Bug c++/23205] [4.0/4.1 Regression] [C++/unit-at-a-time] stabs debug info omitted for global const variables
  2005-08-02 18:43 [Bug debug/23205] New: [C++] debug info omitted for global variables dpatel at apple dot com
                   ` (7 preceding siblings ...)
  2005-08-17 21:08 ` pinskia at gcc dot gnu dot org
@ 2005-09-18  2:18 ` pinskia at gcc dot gnu dot org
  2005-09-27 15:58 ` mmitchel at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-18  2:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-18 02:18 -------
This is really a bug in the front-end where we don't keep a reference to j still.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2005-08-02 18:57:31         |2005-09-18 02:18:32
               date|                            |


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


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

* [Bug c++/23205] [4.0/4.1 Regression] [C++/unit-at-a-time] stabs debug info omitted for global const variables
  2005-08-02 18:43 [Bug debug/23205] New: [C++] debug info omitted for global variables dpatel at apple dot com
                   ` (8 preceding siblings ...)
  2005-09-18  2:18 ` pinskia at gcc dot gnu dot org
@ 2005-09-27 15:58 ` mmitchel at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 15:58 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.2                       |4.0.3


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


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

end of thread, other threads:[~2005-09-27 15:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-02 18:43 [Bug debug/23205] New: [C++] debug info omitted for global variables dpatel at apple dot com
2005-08-02 18:45 ` [Bug debug/23205] [C++] debug info omitted for global static const variables pinskia at gcc dot gnu dot org
2005-08-02 18:45 ` [Bug debug/23205] [C++] debug info omitted for global " pinskia at gcc dot gnu dot org
2005-08-02 18:57 ` [Bug c++/23205] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-08-02 19:00 ` [Bug c++/23205] [4.0/4.1 Regression] [C++/unit-at-a-time] " dpatel at apple dot com
2005-08-02 19:02 ` [Bug c++/23205] [4.0/4.1 Regression] [C++/unit-at-a-time] stabs " pinskia at gcc dot gnu dot org
2005-08-13  0:33 ` wilson at gcc dot gnu dot org
2005-08-17 20:44 ` tomas dot vanek at fbl dot cz
2005-08-17 21:08 ` pinskia at gcc dot gnu dot org
2005-09-18  2:18 ` pinskia at gcc dot gnu dot org
2005-09-27 15:58 ` mmitchel at gcc dot gnu dot org

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