This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gdb 4.17.0.5 is released.


Hi,

While looking at the egcs 1.1.1 PPro bug report:

http://www.cygnus.com/ml/egcs-bugs/1998-Nov/0476.html

I found a bug in my gdb 4.17.0.4. With gdb 4.17.0.5, it
is quite easy to see what is going on in FPU:

(gdb) b 52
Breakpoint 1 at 0x8048582: file ppro.c, line 52.
(gdb) r
Starting program: /home/hjl/bugs/gcc/ppro/opt/a.out 

Breakpoint 1, main () at ppro.c:52
52              if (diff > maxd)        /* record maximum difference */
(gdb) p/x $pc
$2 = 0x8048582
(gdb) disass 0x8048580 0x8048588
Dump of assembler code from 0x8048580 to 0x8048588:
0x8048580 <main+176>:   fabs   
0x8048582 <main+178>:   fcomi  %st(2),%st
0x8048584 <main+180>:   jbe    0x804858a <main+186>
0x8048586 <main+182>:   fstp   %st(2)
End of assembler dump.
(gdb) info float
     st0: 0x3fff8000000000000000  Valid Normal 1
     st1: 0x00000000000000000000  Zero  Zero   0
     st2: 0x00000000000000000000  Empty Zero   0
     st3: 0x00000000000000000000  Empty Zero   0
     st4: 0x00000000000000000000  Empty Zero   0
     st5: 0x00000000000000000000  Empty Zero   0
     st6: 0x00000000000000000000  Empty Zero   0
     st7: 0x3fff8000000000000000  Empty Normal 1
   fctrl:     0x037f 64 bit; NEAR; mask INVAL DENOR DIVZ OVERF UNDER LOS;
   fstat:     0x3000 flags 0000; top 6; 
    ftag:     0x4fff
     fip: 0x08048580
     fcs: 0x01e10023
  fopoff: 0x00000000
  fopsel:     0x002b
(gdb) si
0x8048584       52              if (diff > maxd)        /* record maximum difference */
(gdb) info float
     st0: 0x3fff8000000000000000  Valid Normal 1
     st1: 0x00000000000000000000  Zero  Zero   0
     st2: 0x00000000000000000000  Empty Zero   0
     st3: 0x00000000000000000000  Empty Zero   0
     st4: 0x00000000000000000000  Empty Zero   0
     st5: 0x00000000000000000000  Empty Zero   0
     st6: 0x00000000000000000000  Empty Zero   0
     st7: 0x3fff8000000000000000  Empty Normal 1
   fctrl:     0x037f 64 bit; NEAR; mask INVAL DENOR DIVZ OVERF UNDER LOS;
   fstat:     0x3041 flags 0000; top 6; excep INVAL STACK
    ftag:     0x4fff
     fip: 0x08048582
     fcs: 0x03f20023
  fopoff: 0x00000000
  fopsel:     0x002b
(gdb)

As you can see, the code generated by egcs 1.1.1 causes
an FPU stack overflow. It looks like

0x8048582 <main+178>:   fcomi  %st(2),%st

is the problem since there are only st0 and st1 on the stack,
but it tries to access st2.


-- 
H.J. Lu (hjl@gnu.org)
---
Hi, Folks,

This is the beta release of gdb 4.17.0.5, which is based on gdb 4.17
plus x86 hardware watchpoint and FPU support. You need linux 2.0.35
or above, or 2.1.xx to get the x86 FPU to work correctly. The Linux/x86
binary works with all recent kernels and C libraries, and the x86 FPU
support is enabled at the run-time, depending on the kernel version.

Please report any bugs related to gdb 4.17.0.5 to hjl@lucon.org.

Problems:

Because most of system calls in glibc 2 are written in assembly without
frame pointer, gdb may not be able to debug nor get stack trace system
calls on glibc-based 2 systems. Due to this, "make check" may fail in

FAIL: gdb.base/a1-selftest.exp: backtrace through signal handler

with glibc 2.

Also, it is normal to see 

FAIL: gdb.base/interrupt.exp: continue (timeout)
FAIL: gdb.base/interrupt.exp: echo data (timeout)

if there is

XPASS: gdb.base/interrupt.exp: send_gdb end of file

Changes from gdb 4.17.0.4:

1. Fix the Intel FPU tag code handling.

Changes from gdb 4.17.0.3:

1. Fix testcases for FPU.
2. Fix x86 hardware watchpoint support.

Changes from gdb 4.17.0.2:

1. Fake FP registers on older kernels.

Changes from gdb 4.17:

1. Linux/x86 FPU support is added. You can debug floating point numbers
   just like integers.
2. x86 hardware watchpoint is extended to long long, double and long
   double.
3. More information on x86 CPU status register.
4. Fix a bug when reading beyond the memory boundary.

The file list:

1. gdb-4.17-4.17.0.5.diff.gz. Patch against gdb 4.17.
2. gdb-4.17.0.4-4.17.0.5.diff.gz. Patch against gdb 4.17.0.4.
3. gdb-4.17.0.5.x86.gz. Precompiled Linux/x86 statically linked binary.

The ftp sites for my gdb patches:

ftp://ftp.yggdrasil.com/private/hjl
ftp://ftp.kernel.org/pub/linux/devel/gcc

gdb 4.17 source code is available at

ftp://ftp.gnu.org/pub/gnu

To install the precompiled binary,

# gunzp gdb-4.17.0.5.x86.gz
# cp gdb-4.17.0.5.x86 /usr/bin/gdb


H.J.
hjl@gnu.org
11/18/98


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]