From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23437 invoked by alias); 9 Sep 2009 13:45:54 -0000 Received: (qmail 23398 invoked by uid 22791); 9 Sep 2009 13:45:50 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Sep 2009 13:45:39 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id n89DjXoW029042; Wed, 9 Sep 2009 15:45:33 +0200 (CEST) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id n89DjW0u028957; Wed, 9 Sep 2009 15:45:32 +0200 (CEST) Date: Wed, 09 Sep 2009 13:45:00 -0000 Message-Id: <200909091345.n89DjW0u028957@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: teawater@gmail.com CC: gdb-patches@sourceware.org, msnyder@vmware.com In-reply-to: (message from Hui Zhu on Wed, 9 Sep 2009 21:29:07 +0800) Subject: Re: [RFA] Make the prec support signal better[3/4] -- i386-linux References: Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00246.txt.bz2 > From: Hui Zhu > Date: Wed, 9 Sep 2009 21:29:07 +0800 > > This patch make i386-linux support signal record. > When signal happen, i386_linux_record_signal will record the change. > When the signal handler want return, new code in > "i386_linux_intx80_sysenter_record" will record the change. > > i386-linux-tdep.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 71 insertions(+) > > --- a/i386-linux-tdep.c > +++ b/i386-linux-tdep.c > @@ -354,6 +354,33 @@ i386_linux_write_pc (struct regcache *re > regcache_cooked_write_unsigned (regcache, I386_LINUX_ORIG_EAX_REGNUM, -1); > } > > +/* Record all registers for process-record. */ Not quite true isn't it? > +static int > +i386_all_but_ip_registers_record (struct regcache *regcache) > +{ > + if (record_arch_list_add_reg (regcache, I386_EAX_REGNUM)) > + return -1; > + if (record_arch_list_add_reg (regcache, I386_ECX_REGNUM)) > + return -1; > + if (record_arch_list_add_reg (regcache, I386_EDX_REGNUM)) > + return -1; > + if (record_arch_list_add_reg (regcache, I386_EBX_REGNUM)) > + return -1; > + if (record_arch_list_add_reg (regcache, I386_ESP_REGNUM)) > + return -1; > + if (record_arch_list_add_reg (regcache, I386_EBP_REGNUM)) > + return -1; > + if (record_arch_list_add_reg (regcache, I386_ESI_REGNUM)) > + return -1; > + if (record_arch_list_add_reg (regcache, I386_EDI_REGNUM)) > + return -1; > + if (record_arch_list_add_reg (regcache, I386_EFLAGS_REGNUM)) > + return -1; > + > + return 0; > +} Why exactly is it that you're not recording the instruction pointer? > static struct linux_record_tdep i386_linux_record_tdep; > > /* i386_canonicalize_syscall maps from the native i386 Linux set > @@ -388,6 +415,14 @@ i386_linux_intx80_sysenter_record (struc > > regcache_raw_read_signed (regcache, I386_EAX_REGNUM, &syscall_native); > > + if (syscall_native == 119 || syscall_native == 173) > + { Ugh, magic numbers. We have symbolic constants for them isn't it? Any reason not to use them? > +enum i386_linux_signal_stack { > + xstate = 270, > + frame_size = 732, > +}; IMHO, these should be #define's, spelled with all capitals and have I386_LINUX_ prefixes.