From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K0zKz-0004LX-MI for qemu-devel@nongnu.org; Tue, 27 May 2008 09:35:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K0zKx-0004Kl-Sb for qemu-devel@nongnu.org; Tue, 27 May 2008 09:35:37 -0400 Received: from [199.232.76.173] (port=34348 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K0zKx-0004Ke-Hx for qemu-devel@nongnu.org; Tue, 27 May 2008 09:35:35 -0400 Received: from mail.codesourcery.com ([65.74.133.4]:43558) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K0zKx-0003KD-90 for qemu-devel@nongnu.org; Tue, 27 May 2008 09:35:35 -0400 From: Paul Brook Subject: Re: [Qemu-devel] how to get registers value in event of systemcall Date: Tue, 27 May 2008 14:35:30 +0100 References: <483AF801.2020806@slacky.it> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200805271435.30937.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Mulyadi Santosa > > guest operating system at the moment of a system call. In my opinion i've > > to work on file target-i386/translate.c in the case of 0x80 in the > > function disas_insn(DisasContext *s, target_ulong pc_start). I can't > > understand how to get registers value. I've just read documentation about > > translation but I'm not able to get these informations. > > I think you should go to target-i386/translate.c: > gen_intermediate_code_internal(CPUState *env, > TranslationBlock *tb, > int search_pc) > > specifically, in "env" there is "regs" which hold the CPU registers. No, that won't work. Only a very limited subset of the CPU state is valid during translation. The same block may be executed many times with different inputs. If you want register values you have to do it at execution time, e.g. in do_interrupt. Paul