Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@gnu.org>
To: Mark Kettenis <kettenis@chello.nl>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Re: [rfa/amd64] Zero fill 32-bit registers
Date: Fri, 19 Mar 2004 00:09:00 -0000	[thread overview]
Message-ID: <4044B1E1.1020308@gnu.org> (raw)
Message-ID: <20040319000900.HTg3r58KIZk_spsSjRFXVPnG0cdCZ2P1wqLw4DeUCeI@z> (raw)
In-Reply-To: <200402292345.i1TNjC4i000914@elgar.kettenis.dyndns.org>

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

>    The segment registers have the same problem, is the attached ok? 6.1? 
>    With it applied I get test results that approach i386.
> 
>    2004-02-29  Andrew Cagney  <cagney@redhat.com>
> 
> 	   * amd64-nat.c (amd64_collect_native_gregset): Zero-extend the
> 	   32-bit segment registers.
> 
> OK.  Feel free to add the segment registers to enum i386_regnum and
> use <= I386_GS_REGNUM instead of < I386_ST0_REGNUM though.

Attatched is what I've committed (mainline and, in two ticks, 6.1).

A GDB, with that PC==0 hack to work around the GLIBC problems applied, 
gets these unexpected failures:

FAIL: gdb.base/gcore.exp: where in corefile (pattern 1)
FAIL: gdb.base/gcore.exp: corefile restored general registers
FAIL: gdb.base/gcore.exp: corefile restored all registers
FAIL: gdb.base/gcore.exp: capture_command_output failed on print 
array_func::local_array.
FAIL: gdb.base/gcore.exp: corefile restored stack array
FAIL: gdb.base/gcore.exp: corefile restored backtrace
FAIL: gdb.base/interrupt.exp: echo data (timeout)
FAIL: gdb.base/signals.exp: continue to func1 (probably kernel bug)
FAIL: gdb.base/signals.exp: continue to handler (the program exited)
FAIL: gdb.threads/gcore-thread.exp: corefile contains at least two threads
FAIL: gdb.threads/gcore-thread.exp: a corefile thread is executing thread2
FAIL: gdb.threads/gcore-thread.exp: thread2 is current thread in corefile
                 === gdb Summary ===

# of expected passes            9860
# of unexpected failures        12
# of unexpected successes       1
# of expected failures          47
# of unknown successes          12
# of known failures             33
# of untested testcases         3
# of unsupported tests          1

not bad, eh :-)

Andrew


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

2004-03-02  Andrew Cagney  <cagney@redhat.com>

	* i386-tdep.h (enum i386_regnum): Add I386_DS_REGNUM,
	I386_ES_REGNUM, I386_FS_REGNUM, and I386_GS_REGNUM.  Remove
	trailing comma and redundant assignment of I386_ST0_REGNUM.
	* amd64-nat.c (amd64_collect_native_gregset): Zero-extend the
	32-bit segment registers.

Index: amd64-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/amd64-nat.c,v
retrieving revision 1.5
diff -u -r1.5 amd64-nat.c
--- amd64-nat.c	28 Feb 2004 21:55:48 -0000	1.5
+++ amd64-nat.c	2 Mar 2004 15:53:26 -0000
@@ -139,6 +139,12 @@
 	  if (regnum == -1 || regnum == i)
 	    memset (regs + amd64_native_gregset_reg_offset (i), 0, 8);
 	}
+      /* Ditto for %cs, %ss, %ds, %es, %fs, and %gs.  */
+      for (i = I386_CS_REGNUM; i <= I386_GS_REGNUM; i++)
+	{
+	  if (regnum == -1 || regnum == i)
+	    memset (regs + amd64_native_gregset_reg_offset (i), 0, 8);
+	}
     }
 
   if (num_regs > NUM_REGS)
Index: i386-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.h,v
retrieving revision 1.36
diff -u -r1.36 i386-tdep.h
--- i386-tdep.h	22 Feb 2004 11:19:14 -0000	1.36
+++ i386-tdep.h	2 Mar 2004 15:53:26 -0000
@@ -166,7 +166,11 @@
   I386_EFLAGS_REGNUM,		/* %eflags */
   I386_CS_REGNUM,		/* %cs */
   I386_SS_REGNUM,		/* %ss */
-  I386_ST0_REGNUM = 16,		/* %st(0) */
+  I386_DS_REGNUM,		/* %ds */
+  I386_ES_REGNUM,		/* %es */
+  I386_FS_REGNUM,		/* %fs */
+  I386_GS_REGNUM,		/* %gs */
+  I386_ST0_REGNUM		/* %st(0) */
 };
 
 #define I386_NUM_GREGS	16

  reply	other threads:[~2004-03-02 16:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-27  1:22 Andrew Cagney
2004-02-28 10:46 ` Mark Kettenis
2004-02-28 15:17   ` Andrew Cagney
2004-02-28 17:35     ` Mark Kettenis
2004-02-28 19:18       ` Andrew Cagney
2004-02-28 20:26         ` Mark Kettenis
2004-02-28 20:40           ` Andrew Cagney
2004-02-28 21:56             ` [PATCH] " Mark Kettenis
2004-02-29 23:11               ` Andrew Cagney
2004-02-29 23:45                 ` Mark Kettenis
2004-03-02 16:10                   ` Andrew Cagney [this message]
2004-03-19  0:09                     ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4044B1E1.1020308@gnu.org \
    --to=cagney@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kettenis@chello.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox