public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/19251] New: gstabs emits wrong entry for "unsigned int/long" types on powerpc
@ 2005-01-04  8:41 gleb76 at gmail dot com
  2005-01-04  8:49 ` [Bug debug/19251] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: gleb76 at gmail dot com @ 2005-01-04  8:41 UTC (permalink / raw)
  To: gcc-bugs

Hello,

I have problem with gcc3.x and stabs debugging format on powerpc (ppc32 603e).
gdb doesn't recognize builtin unsigned int/long formats.

I compile the following program with: powerpc-gcc -gstabs a.c
int main()
{       
        unsigned int a;
        int b;
        
        return 0;
}
and try to debug it:
> gdb a.out
(gdb) b main
Breakpoint 1 at 0x100003bc: file a.c, line 6.
(gdb) r
Starting program: a.out

Breakpoint 1, main () at a.c:6
6               return 0;
(gdb) info locals
a = <error type>
b = -1
(gdb)  q
The program is running.  Exit anyway? (y or n) y
>

After little investigation I discovered that gcc emits wrong stabs entry for
unsigned int format.
.stabs  "unsigned int:t(0,4)=r(0,4);0;4294967295;",128,0,0,0
The problem is with the max value. According to gdb source code if the value
too big for int it should be emitted in octal. Here is what gcc for intel emits
in this case by the way:
.stabs  "unsigned int:t(0,4)=r(0,4);0;-1;",128,0,0,0

After further investigation I saw that HOST_BITS_PER_WIDE_INT for powerpc is
defined to 64 and gdb rightfully things that widest int is 32 bit long on my 32
bit powerpc CPU and bails out since constant from stabs entry is to big. The
definition of HOST_BITS_PER_WIDE_INT depends on need_64bit_hwint from config.gcc
and it's set to "yes" for all powerpc CPUs there.

I've removed definition of need_64bit_hwint for powerpc and the result compiler
emits right stab entry now, but it can't compile glibc. The error is in file
glibc-2.3.2/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h. It uses __uint128_t
and gcc provides it only if HOST_BITS_PER_WIDE_INT is at least 64 bits.

-- 
           Summary: gstabs emits wrong entry for "unsigned int/long" types
                    on powerpc
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gleb76 at gmail dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-linux-gnu
  GCC host triplet: i686-linux-gnu
GCC target triplet: powerpc-linux-gnu


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


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

* [Bug debug/19251] gstabs emits wrong entry for "unsigned int/long" types on powerpc
  2005-01-04  8:41 [Bug c/19251] New: gstabs emits wrong entry for "unsigned int/long" types on powerpc gleb76 at gmail dot com
@ 2005-01-04  8:49 ` pinskia at gcc dot gnu dot org
  2005-01-04  9:02 ` gleb76 at gmail dot com
  2005-01-04 11:01 ` gleb76 at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-04  8:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-04 08:49 -------
Hmm, what version of gdb is this, since I tried on ppc-darwin and it produces what you consided back 
stabs and it worked (this is gdb 5.3).

Also why use stabs when dwarf-2 works better and most of the time produces small debugging info 
and still provides more information?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |debug
           Keywords|                            |wrong-debug


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


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

* [Bug debug/19251] gstabs emits wrong entry for "unsigned int/long" types on powerpc
  2005-01-04  8:41 [Bug c/19251] New: gstabs emits wrong entry for "unsigned int/long" types on powerpc gleb76 at gmail dot com
  2005-01-04  8:49 ` [Bug debug/19251] " pinskia at gcc dot gnu dot org
@ 2005-01-04  9:02 ` gleb76 at gmail dot com
  2005-01-04 11:01 ` gleb76 at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: gleb76 at gmail dot com @ 2005-01-04  9:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gleb76 at gmail dot com  2005-01-04 09:02 -------
I forgot to mension the gdb I've tried are 6.0 and 6.3.
The problem is in the stabsread.c file in function read_huge_number.

The stabs produce much smaller output for me. The result file using stabs is
23M and with dwarf-2 70M. I can debug it no my embeded system.

-- 


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


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

* [Bug debug/19251] gstabs emits wrong entry for "unsigned int/long" types on powerpc
  2005-01-04  8:41 [Bug c/19251] New: gstabs emits wrong entry for "unsigned int/long" types on powerpc gleb76 at gmail dot com
  2005-01-04  8:49 ` [Bug debug/19251] " pinskia at gcc dot gnu dot org
  2005-01-04  9:02 ` gleb76 at gmail dot com
@ 2005-01-04 11:01 ` gleb76 at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: gleb76 at gmail dot com @ 2005-01-04 11:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gleb76 at gmail dot com  2005-01-04 11:01 -------
(In reply to comment #1)
> Hmm, what version of gdb is this, since I tried on ppc-darwin and it produces
what you consided back 
> stabs and it worked (this is gdb 5.3).
> 
gdb 5.3 doesn't work for me. Do you use vanilla gdb?


-- 


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


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

end of thread, other threads:[~2005-01-04 11:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-04  8:41 [Bug c/19251] New: gstabs emits wrong entry for "unsigned int/long" types on powerpc gleb76 at gmail dot com
2005-01-04  8:49 ` [Bug debug/19251] " pinskia at gcc dot gnu dot org
2005-01-04  9:02 ` gleb76 at gmail dot com
2005-01-04 11:01 ` gleb76 at gmail dot com

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