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

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