Subject: Re: gdb + print fun() doesn't work any more
To: None <tech-toolchain@netbsd.org>
From: Love <lha@stacken.kth.se>
List: tech-toolchain
Date: 01/17/2002 00:35:25
Love <lha@stacken.kth.se> writes:

> I've a problem with gdb and running functions in the `print' command.  This
> used to work before. I've got no clue when it stopped to work.

Follow up to myself now when I've turned on the brain.

Is the struct xmmctx->opcode register the same as struct env387->opcode
register the same ? Looks that way in
sys/arch/i386/i386/process_machdep.c:process_s87_to_xmm().

In that case this patch will help.

Love



Index: i386nbsd-nat.c
===================================================================
RCS file: /cvsroot/gnusrc/gnu/dist/toolchain/gdb/i386nbsd-nat.c,v
retrieving revision 1.5
diff -u -w -r1.5 i386nbsd-nat.c
--- i386nbsd-nat.c	2001/12/09 23:27:19	1.5
+++ i386nbsd-nat.c	2002/01/16 23:31:02
@@ -164,6 +164,9 @@
 
   RF (FDOFF_REGNUM,   sxmm->operand);
 
+  reg = sxmm->opcode;
+  RF (FOP_REGNUM,     reg);
+
   /* The kernel has provided us the "tag" info in XMM format, but
      GDB expects it in i387 format; convert it.  */
   for (reg = 0, i = 0; i < 8; i++)