This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH RFA]: Fix i386-linux-nat.c fill_gregset()
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: Kevin Buettner <kevinb at cygnus dot com>,Mark Kettenis <kettenis at science dot uva dot nl>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Sat, 17 Nov 2001 13:13:06 -0500
- Subject: Re: [PATCH RFA]: Fix i386-linux-nat.c fill_gregset()
- References: <1011117101740.ZM5510@ocotillo.lan>
> Okay to commit?
>
> * i386-linux-nat.c (fill_gregset): Don't invoke read_register_gen()
> when fetching ORIG_EAX.
>
> Index: i386-linux-nat.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/i386-linux-nat.c,v
> retrieving revision 1.29
> diff -u -p -r1.29 i386-linux-nat.c
> --- i386-linux-nat.c 2001/11/04 14:30:42 1.29
> +++ i386-linux-nat.c 2001/11/17 09:14:41
> @@ -325,7 +325,8 @@ fill_gregset (elf_gregset_t *gregsetp, i
> *(regp + regmap[i]) = *(elf_greg_t *) ®isters[REGISTER_BYTE (i)];
>
> if (regno == -1 || regno == I386_LINUX_ORIG_EAX_REGNUM)
> - read_register_gen (I386_LINUX_ORIG_EAX_REGNUM, (char *) (regp + ORIG_EAX));
> + *(regp + regmap[ORIG_EAX]) =
> + *(elf_greg_t *) ®isters[REGISTER_BYTE (I386_LINUX_ORIG_EAX_REGNUM)];
> }
>
> #ifdef HAVE_PTRACE_GETREGS
FYI,
Using registers[] is wrong. The code should be using regcache_collect().
Andrew