From: pfieland@citron.sw.stratus.com (Peggy Fieland)
Subject: (none)
Organization: GNUs Not Usenet
Distribution: gnu
Date: Fri, 10 Apr 1992 15:08:29 GMT

I am running gdb-4.3 on a stratus i860 (big endian) under SVR4.
I have found a bug in the "info registers" command.  This command
always gets the registers relative to the innermost frame (frame 0).

Here is a fix:

diff sc-gdb/gdb/i860-tdep.c gdb/i860-tdep.c
1321,1322c1321
< #if 0
< /* This routine is uncalled -- remove this routine sometime */
---
> 
1328,1329c1327,1334
<    
<    read_relative_register_raw_bytes (regno, raw_buffer);
---
> 
>    /* NOTE that only  integer and floating point registers can be relative to a frame */
> 
>    if ((regno >= R0) && (regno <= F31)) /* user register */
>       read_relative_register_raw_bytes (regno, raw_buffer);
>    else
>       bcopy (&registers[regno << 2], raw_buffer, sizeof (long));
> 
1333d1337
< #endif
1427c1431,1434
<    on the floating point registers, so we ignore the parameter fpregs */
---
>    on the floating point registers, so we ignore the parameter fpregs. 
>    NOTE also  that only  integer and floating point registers can be relative to a frame --
>    see subroutine get_reg (above ) */
> 
1443,1446c1450
<          if ((regnum >=F0 ) && (regnum <= F31))
<             bcopy (&registers[ADJ_FREG(regnum)<<2], &val, sizeof (long));
<          else
<             bcopy (&registers[regnum<<2], &val, sizeof (long));
---
>          val = get_reg(regnum);
1456c1460
<                bcopy (&registers[j<<2], &val, sizeof (long));
---
>                val = get_reg(j);
1462c1466
<          bcopy (&registers[EPSR<<2], &val, sizeof (long));
---
>          val = get_reg(EPSR);
1466c1470
<          bcopy (&registers[FSR<<2], &val, sizeof (long));
---
>          val = get_reg(FSR);
1470c1474
<          bcopy (&registers[CCR<<2], &val, sizeof (long));
---
>          val = get_reg(CCR);
1473c1477
<          bcopy (&registers[BEAR<<2], &val, sizeof (long));
---
>          val = get_reg(BEAR);
1480c1484
<                bcopy (&registers[j<<2], &val, sizeof (long));
---
>                val = get_reg(j);
1492c1496
<                bcopy (&registers[j<<2], &val, sizeof (long));
---
>                val = get_reg(j);
1503c1507
<                bcopy (&registers[ADJ_FREG(j)<<2], &val, sizeof (long));
---
>                val = get_reg(j);
1515,1516c1519,1520
<                bcopy (&registers[j<<2], &val, sizeof (long));
<                bcopy (&registers[(j+1)<<2], &valh, sizeof (long));
---
>                val = get_reg(j);
>                valh = get_reg(j+1);
1524,1525c1528,1529
<             bcopy (&registers[j<<2], &val, sizeof (long));
<             bcopy (&registers[(j+1)<<2], &valh, sizeof (long));
---
>             val = get_reg(j);
>             valh = get_reg(j+1);
1533,1536c1537,1542
<                bcopy (&registers[j<<2], &val, sizeof (long));
<                bcopy (&registers[(j+1)<<2], &valh, sizeof (long));
<                bcopy (&registers[(j+2)<<2], &val2, sizeof (long));
<                bcopy (&registers[(j+3)<<2], &val3, sizeof (long));
---
>                
>                val = get_reg(j);
>                valh = get_reg(j+1);
>                val2 = get_reg(j+2);
>                val3 = get_reg(j+3);
> 
1545,1549c1551,1557
<                bcopy (&registers[i<<2], &val4, sizeof (long));
<                bcopy (&registers[j<<2], &val, sizeof (long));
<                bcopy (&registers[(j+1)<<2], &valh, sizeof (long));
<                bcopy (&registers[k<<2], &val2, sizeof (long));
<                bcopy (&registers[(k+1)<<2], &val3, sizeof (long));
---
> 
>                val4 = get_reg(i);
>                val = get_reg(j);
>                valh = get_reg(j+1);
>                val2 = get_reg(k);
>                val3 = get_reg(k+1);
> 


Newsgroups: gnu.gdb.bug