------- Additional Comments From dpatel at apple dot com  2005-07-22 23:29 
-------
Subject: Re:  [4.0 Regression] debug info omitted for uninitialized variables


On Jul 22, 2005, at 12:33 PM, cvs-commit at gcc dot gnu dot org wrote:

>
> ------- Additional Comments From cvs-commit at gcc dot gnu dot org   
> 2005-07-22 19:33 -------
> Subject: Bug 21828
>
> CVSROOT:    /cvs/gcc
> Module name:    gcc
> Branch:     gcc-4_0-branch
> Changes by:    [EMAIL PROTECTED]    2005-07-22 19:33:16
>
> Modified files:
>     gcc            : ChangeLog toplev.c varasm.c
>     gcc/testsuite  : ChangeLog
> Added files:
>     gcc/testsuite/gcc.dg/debug/dwarf2: dwarf-uninit.c
>
> Log message:
>     PR debug/21828
>     * toplev.c (check_global_declarations): Do not mark undefined
>     variables as DECL_IGNORED_P.
>     * varasm.c (first_global_object_name): GTY it.
>     (weak_global_object_name): Likewise.
>     (notice_global_symbol): Use ggc_strdup, not xstrdup, when creating
>     a string to go into {weak,first}_global_object_name.
>
>     PR debug/21828
>     * gcc.dg/debug/dwarf2/dwarf-uninit.c: New test.
>
> 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.327&r2=2.7592.2.328
> 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.4&r2=1.944.2.5
> http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/varasm.c.diff? 
> cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.477.6.12&r2=1.477.6.13
> http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ 
> ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0- 
> branch&r1=1.5084.2.293&r2=1.5084.2.294
> http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/ 
> debug/dwarf2/dwarf-uninit.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0- 
> branch&r1=NONE&r2=1.1.2.1
>

After this check-in :

$ cat t.c
static int foo;
int bar;
int main(void)
{
   foo += 3;
   bar *= 5;
   return 0;
}

$ xgcc -g  -O2 -o t t.c
$ cat gdbcmds
b main
ptype foo
ptype bar
p foo
p bar
$ gdb --batch -x gdbcmds t
Reading symbols for shared libraries ... done
Breakpoint 1 at 0x2d14: file t.c, line 6.
type = <unknown type>
type = <unknown type>
$1 = <unknown type>
$2 = <unknown type>

This is on powerpc-darwin. I expected this patch to fix this. Am I  
missing something ?

Thanks,
-
Devang


-- 


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

Reply via email to