[Bug debug/23190] [4.0/4.1 Regression] debug info omitted for uninitialized variables (stabs)

2005-09-08 Thread rth at gcc dot gnu dot org

--- Additional Comments From rth at gcc dot gnu dot org  2005-09-09 01:08 
---
Fixed.

-- 
   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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


[Bug debug/23190] [4.0/4.1 Regression] debug info omitted for uninitialized variables (stabs)

2005-09-08 Thread cvs-commit at gcc dot gnu dot org

--- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-09-09 
00:52 ---
Subject: Bug 23190

CVSROOT:/cvs/gcc
Module name:gcc
Branch: gcc-4_0-branch
Changes by: [EMAIL PROTECTED]   2005-09-09 00:51:59

Modified files:
gcc: ChangeLog c-decl.c langhooks.c toplev.c 
 toplev.h 
gcc/cp : ChangeLog decl.c decl2.c 
Added files:
gcc/testsuite/gcc.dg/debug: 20050907-1.c 
gcc/testsuite/gcc.dg/debug/dwarf2: var1.c var2.c 

Log message:
PR debug/23190
* toplev.c (wrapup_global_declaration_1): Split out ...
(wrapup_global_declaration_2): ... from ...
(wrapup_global_declarations): ... here.  Return bool.
(check_global_declaration_1): Split out ...
(check_global_declarations): from here.
(emit_debug_global_declarations): New.
* toplev.h (wrapup_global_declaration_1, wrapup_global_declaration_2,
check_global_declaration_1, emit_debug_global_declarations): Declare.
* c-decl.c (c_write_global_declarations_1): Don't create a vector
of decls.  Call wrapup_global_declaration_1,
wrapup_global_declaration_2, check_global_declaration_1 directly.
(c_write_global_declarations_2): New.
(ext_block): New.
(c_write_global_declarations): Call c_write_global_declarations_2.
* langhooks.c (write_global_declarations): Call
emit_debug_global_declarations.
cp/
* decl.c (wrapup_globals_for_namespace): Call
emit_debug_global_declarations.
* decl2.c (cp_finish_file): Likewise.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.420&r2=2.7592.2.421
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.630.6.17&r2=1.630.6.18
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/langhooks.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.81.2.1&r2=1.81.2.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/toplev.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.944.2.5&r2=1.944.2.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/toplev.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.133&r2=1.133.8.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4648.2.96&r2=1.4648.2.97
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.1371.2.21&r2=1.1371.2.22
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.770.2.6&r2=1.770.2.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/debug/20050907-1.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/debug/dwarf2/var1.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/debug/dwarf2/var2.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1



-- 


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


[Bug debug/23190] [4.0/4.1 Regression] debug info omitted for uninitialized variables (stabs)

2005-09-08 Thread cvs-commit at gcc dot gnu dot org

--- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-09-09 
00:47 ---
Subject: Bug 23190

CVSROOT:/cvs/gcc
Module name:gcc
Changes by: [EMAIL PROTECTED]   2005-09-09 00:47:05

Modified files:
gcc: ChangeLog c-decl.c cgraphunit.c langhooks.c 
 passes.c toplev.c toplev.h 
gcc/cp : ChangeLog decl.c decl2.c 
Added files:
gcc/testsuite/gcc.dg/debug: 20050907-1.c 
gcc/testsuite/gcc.dg/debug/dwarf2: var1.c var2.c 

Log message:
PR debug/23190
* toplev.c (wrapup_global_declaration_1): Split out ...
(wrapup_global_declaration_2): ... from ...
(wrapup_global_declarations): ... here.  Return bool.
(check_global_declaration_1): Split out ...
(check_global_declarations): from here.
(emit_debug_global_declarations): New.
* toplev.h (wrapup_global_declaration_1, wrapup_global_declaration_2,
check_global_declaration_1, emit_debug_global_declarations): Declare.
* c-decl.c (c_write_global_declarations_1): Don't create a vector
of decls.  Call wrapup_global_declaration_1,
wrapup_global_declaration_2, check_global_declaration_1 directly.
(c_write_global_declarations_2): New.
(ext_block): New.
(c_write_global_declarations): Call c_write_global_declarations_2.
* langhooks.c (write_global_declarations): Call
emit_debug_global_declarations.
* cgraphunit.c (cgraph_varpool_remove_unreferenced_decls): Don't
remove decls that have DECL_RTL_SET_P.
* passes.c (rest_of_decl_compilation): Invoke
cgraph_varpool_finalize_decl for all but functions.
cp/
* decl.c (wrapup_globals_for_namespace): Call
emit_debug_global_declarations.
* decl2.c (cp_finish_file): Likewise.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9920&r2=2.9921
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&r1=1.683&r2=1.684
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cgraphunit.c.diff?cvsroot=gcc&r1=1.127&r2=1.128
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/langhooks.c.diff?cvsroot=gcc&r1=1.84&r2=1.85
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/passes.c.diff?cvsroot=gcc&r1=2.110&r2=2.111
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/toplev.c.diff?cvsroot=gcc&r1=1.974&r2=1.975
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/toplev.h.diff?cvsroot=gcc&r1=1.141&r2=1.142
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4879&r2=1.4880
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1423&r2=1.1424
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&r1=1.798&r2=1.799
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/debug/20050907-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/debug/dwarf2/var1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/debug/dwarf2/var2.c.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


[Bug debug/23190] [4.0/4.1 Regression] debug info omitted for uninitialized variables (stabs)

2005-09-07 Thread rth at gcc dot gnu dot org

--- Additional Comments From rth at gcc dot gnu dot org  2005-09-08 02:42 
---
A more severe example is gdb.base/call-ar-st.c wherein the local static variable
"double_array" is not put to the debug info at all.  Not even its name as in the
example here.

-- 


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


[Bug debug/23190] [4.0/4.1 Regression] debug info omitted for uninitialized variables (stabs)

2005-09-07 Thread rth at gcc dot gnu dot org


-- 
   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |rth at gcc dot gnu dot org
   |dot org |
 Status|NEW |ASSIGNED
   Last reconfirmed|2005-08-02 00:37:12 |2005-09-08 02:39:32
   date||


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


[Bug debug/23190] [4.0/4.1 Regression] debug info omitted for uninitialized variables (stabs)

2005-08-02 Thread dpatel at apple dot com

--- Additional Comments From dpatel at apple dot com  2005-08-02 17:21 
---
Subject: Re:  [4.0/4.1 Regression] debug info omitted for uninitialized 
variables (stabs)


On Aug 2, 2005, at 10:16 AM, mark at codesourcery dot com wrote:

> It sounds sensible enough, but I really haven't studied how the C  
> front
> end does things well enough to know for sure.  I would ask Joseph  
> and RTH.

OK.




-- 


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


[Bug debug/23190] [4.0/4.1 Regression] debug info omitted for uninitialized variables (stabs)

2005-08-02 Thread mark at codesourcery dot com

--- Additional Comments From mark at codesourcery dot com  2005-08-02 17:16 
---
Subject: Re:  [4.0/4.1 Regression] debug info omitted for
 uninitialized variables (stabs)

dpatel at apple dot com wrote:
> --- Additional Comments From dpatel at apple dot com  2005-08-02 17:12 
> ---
> Subject: Re:  [4.0/4.1 Regression] debug info omitted for uninitialized 
> variables (stabs)
> 
> 
> On Aug 2, 2005, at 10:00 AM, mmitchel at gcc dot gnu dot org wrote:
> 
> 
>>--- Additional Comments From mmitchel at gcc dot gnu dot org   
>>2005-08-02 17:00 ---
>>Devang --
>>
>>The DWARF-2 information looks correct to me, from the section of  
>>DWARF-2 code
>>that you posted in the original report for this bug.  I know GDB  
>>doesn't print
>>the variable, but I don't think that's the compiler's fault; the  
>>information
>>looks OK.  Is there something wrong with the DWARF-2 generated, or  
>>is this just
>>a GDB bug?
> 
> 
> Without the patch, GCC does not emit DW_OP_addr and DW_AT_location.

Yes -- but that's no excuse for GDB not being able to show us the type!

> There is only one regression. One way to avoid it is to split  
> wrapup_global...
> in two halves. One to emit code and second to generate debug info.  
> This allows
> C front end to put cgraph_optimize() after writing globals but before
> generating debug info.

It sounds sensible enough, but I really haven't studied how the C front 
end does things well enough to know for sure.  I would ask Joseph and RTH.



-- 


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


[Bug debug/23190] [4.0/4.1 Regression] debug info omitted for uninitialized variables (stabs)

2005-08-02 Thread dpatel at apple dot com

--- Additional Comments From dpatel at apple dot com  2005-08-02 17:12 
---
Subject: Re:  [4.0/4.1 Regression] debug info omitted for uninitialized 
variables (stabs)


On Aug 2, 2005, at 10:00 AM, mmitchel at gcc dot gnu dot org wrote:

>
> --- Additional Comments From mmitchel at gcc dot gnu dot org   
> 2005-08-02 17:00 ---
> Devang --
>
> The DWARF-2 information looks correct to me, from the section of  
> DWARF-2 code
> that you posted in the original report for this bug.  I know GDB  
> doesn't print
> the variable, but I don't think that's the compiler's fault; the  
> information
> looks OK.  Is there something wrong with the DWARF-2 generated, or  
> is this just
> a GDB bug?

Without the patch, GCC does not emit DW_OP_addr and DW_AT_location.

> I'm not oppposed to making the kind of change you're proposing for  
> the C front
> end; I suggested the same thing.  But, it is a complex change; as  
> you've noted,
> there are regressions when you try it.

There is only one regression. One way to avoid it is to split  
wrapup_global...
in two halves. One to emit code and second to generate debug info.  
This allows
C front end to put cgraph_optimize() after writing globals but before
generating debug info.

thoughts ?
-
Devang



-- 


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


[Bug debug/23190] [4.0/4.1 Regression] debug info omitted for uninitialized variables (stabs)

2005-08-02 Thread mmitchel at gcc dot gnu dot org

--- Additional Comments From mmitchel at gcc dot gnu dot org  2005-08-02 
17:00 ---
Devang --

The DWARF-2 information looks correct to me, from the section of DWARF-2 code
that you posted in the original report for this bug.  I know GDB doesn't print
the variable, but I don't think that's the compiler's fault; the information
looks OK.  Is there something wrong with the DWARF-2 generated, or is this just
a GDB bug?

I'm not oppposed to making the kind of change you're proposing for the C front
end; I suggested the same thing.  But, it is a complex change; as you've noted,
there are regressions when you try it.

-- Mark

-- 


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


[Bug debug/23190] [4.0/4.1 Regression] debug info omitted for uninitialized variables (stabs)

2005-08-02 Thread dpatel at apple dot com

--- Additional Comments From dpatel at apple dot com  2005-08-02 16:52 
---
Subject: Re:  [4.0/4.1 Regression] debug info omitted for uninitialized 
variables (stabs)


On Aug 1, 2005, at 8:25 PM, mark at codesourcery dot com wrote:

> In any case, the problem is now either in the C front end or in the  
> DBX
> generator.  Since the DWARF-2 generators do something reasonable,
> AFAICT, I would guess the problem is in either the DBX generator,  
> or the
>   GDB reader for STABS, or in the STABS format itself.

This does not look like STABS or DWARF-2 specific. Right now it
does work even in DWARF-2 mode also. With the attached patch it DWARF-2
also works.

GCC Mainline ===

Using stabs ===
Reading symbols for shared libraries .. done
Breakpoint 1 at 0x1d9c: file /tmp/t.c, line 6.
type = 
type = 
$1 = 
$2 = 

Using DWARF ===
Reading symbols for shared libraries .. done
Breakpoint 1 at 0x2d04: file /tmp/t.c, line 6.
type = 
type = int
$1 = 
$2 = 0

GCC Mainline with fix===

Using stabs ===
Reading symbols for shared libraries .. done
Breakpoint 1 at 0x1d9c: file /tmp/t.c, line 6.
type = int
type = int
$1 = 0
$2 = 0

Using DWARF ===
Reading symbols for shared libraries .. done
Breakpoint 1 at 0x2d04: file /tmp/t.c, line 6.
type = int
type = int
$1 = 0
$2 = 0


-
Devang



-- 


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


[Bug debug/23190] [4.0/4.1 Regression] debug info omitted for uninitialized variables (stabs)

2005-08-01 Thread mark at codesourcery dot com

--- Additional Comments From mark at codesourcery dot com  2005-08-02 03:25 
---
Subject: Re:  [4.0/4.1 Regression] debug info omitted for
 uninitialized variables (stabs)

pinskia at gcc dot gnu dot org wrote:
> --- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-02 
> 00:42 ---
> Actually the PR 21828 was orginally about stabs and not about dwarf-2:
> "When using gdb-309 and gdb-370 on MacOS X 10.3.9, even the simplest queries 
> seem broken." so 
> really PR 21828 should never been closed until the stabs problem was fixed.

Then the test case in the PR (which you provided) should not have used 
DWARF-2.  I rely on the bugmasters to reduce bugs -- and they do a great 
job.

In any case, the problem is now either in the C front end or in the DBX 
generator.  Since the DWARF-2 generators do something reasonable, 
AFAICT, I would guess the problem is in either the DBX generator, or the 
  GDB reader for STABS, or in the STABS format itself.



-- 


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


[Bug debug/23190] [4.0/4.1 Regression] debug info omitted for uninitialized variables (stabs)

2005-08-01 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-02 
00:42 ---
Actually the PR 21828 was orginally about stabs and not about dwarf-2:
"When using gdb-309 and gdb-370 on MacOS X 10.3.9, even the simplest queries 
seem broken." so 
really PR 21828 should never been closed until the stabs problem was fixed.

-- 


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


[Bug debug/23190] [4.0/4.1 Regression] debug info omitted for uninitialized variables (stabs)

2005-08-01 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-02 
00:40 ---
It is obvious the debug info is not being outputted for stabs.

-- 


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


[Bug debug/23190] [4.0/4.1 Regression] debug info omitted for uninitialized variables (stabs)

2005-08-01 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-02 
00:37 ---
Confirmed, this makes hard to debug on powerpc-darwin and powerpc-aix.

-- 
   What|Removed |Added

 CC||pinskia at gcc dot gnu dot
   ||org, mmitchel at gcc dot gnu
   ||dot org
   Severity|normal  |critical
 Status|UNCONFIRMED |NEW
 Ever Confirmed||1
   Keywords||wrong-debug
   Last reconfirmed|-00-00 00:00:00 |2005-08-02 00:37:12
   date||
Summary|debug info omitted for  |[4.0/4.1 Regression] debug
   |uninitialized variables |info omitted for
   ||uninitialized variables
   ||(stabs)
   Target Milestone|--- |4.0.2


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