Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Set ADDR
@ 2002-08-20 20:33 Andrew Cagney
  2002-08-21  8:44 ` Andrew Cagney
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cagney @ 2002-08-20 20:33 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 406 bytes --]

Hello,

The bug below and the attached patch are just scary!

(top-gdb) print $r0
$4 = 209
(top-gdb) print $r2
$5 = 0
(top-gdb) set $r2 = 0
(top-gdb) print $r2
$6 = 0
(top-gdb) print $r0
$7 = 0

``addr'' the offset into the registers buffer wasn't being set which 
would lead to register zero always being set.

The worry is that I didn't pick up any testsuite failures :-(

committed the attached,
Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 831 bytes --]

2002-08-19  Andrew Cagney  <ac131313@redhat.com>

	* frame.c (frame_register_unwind): When a register, set addrp to
	the register's byte.

Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.14
diff -u -r1.14 frame.c
--- frame.c	6 Aug 2002 22:42:56 -0000	1.14
+++ frame.c	21 Aug 2002 03:16:11 -0000
@@ -142,7 +142,9 @@
 	 register cache.  */
       *optimizedp = 0;
       *lvalp = lval_register;
-      *addrp = 0;
+      /* ULGH!  Code uses the offset into the raw register byte array
+         as a way of identifying a register.  */
+      *addrp = REGISTER_BYTE (regnum);
       /* Should this code test ``register_cached (regnum) < 0'' and do
          something like set realnum to -1 when the register isn't
          available?  */

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

* Re: Set ADDR
  2002-08-20 20:33 Set ADDR Andrew Cagney
@ 2002-08-21  8:44 ` Andrew Cagney
  2002-08-21 18:01   ` Elena Zannoni
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cagney @ 2002-08-21  8:44 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

PS: If anyone things this is just a PPC bug:

(top-gdb) info registers
eax            0xbffff864       -1073743772
ecx            0x0      0
...
(top-gdb) set $ecx = 0
(top-gdb) info registers
eax            0x0      0
ecx            0x0      0
...

So I guess two things:

- GDB's testsuite doesn't cover this
- Someone modifying a register or register variable is a pretty rare 
occurance

Perhaphs I should add a sleep(1) to the value write code and see how 
long it takes someone to notice that ;-)

enjoy,
Andrew


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

* Re: Set ADDR
  2002-08-21  8:44 ` Andrew Cagney
@ 2002-08-21 18:01   ` Elena Zannoni
  0 siblings, 0 replies; 3+ messages in thread
From: Elena Zannoni @ 2002-08-21 18:01 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

Andrew Cagney writes:
 > PS: If anyone things this is just a PPC bug:
 > 
 > (top-gdb) info registers
 > eax            0xbffff864       -1073743772
 > ecx            0x0      0
 > ...
 > (top-gdb) set $ecx = 0
 > (top-gdb) info registers
 > eax            0x0      0
 > ecx            0x0      0
 > ...
 > 
 > So I guess two things:
 > 
 > - GDB's testsuite doesn't cover this

The altivec-regs.exp file covers this, and, soon, a booke-regs.exp.
But nothing else.

 > - Someone modifying a register or register variable is a pretty rare 
 > occurance
 > 

Yeah. I noticed this failure last night while retesting the booke code,
but by morning it was fixed! Miracle!

 > Perhaphs I should add a sleep(1) to the value write code and see how 
 > long it takes someone to notice that ;-)
 > 
 > enjoy,
 > Andrew


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

end of thread, other threads:[~2002-08-22  1:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-20 20:33 Set ADDR Andrew Cagney
2002-08-21  8:44 ` Andrew Cagney
2002-08-21 18:01   ` Elena Zannoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox