Received: from eggs.gnu.org ([208.118.235.92]:48675) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SguKi-0001EH-0O for qemu-devel@nongnu.org; Tue, 19 Jun 2012 05:02:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SguKb-0003Dt-0X for qemu-devel@nongnu.org; Tue, 19 Jun 2012 05:02:43 -0400 Received: from csmailer.cs.nctu.edu.tw ([140.113.235.130]:10233) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SguKa-0003DD-BV for qemu-devel@nongnu.org; Tue, 19 Jun 2012 05:02:36 -0400 Date: Tue, 19 Jun 2012 17:02:30 +0800 From: =?utf-8?B?6Zmz6Z+L5Lu7IChXZWktUmVuIENoZW4p?= Message-ID: <20120619090230.GA39361@cs.nctu.edu.tw> References: <20120618074756.GA47810@cs.nctu.edu.tw> <4FDEFC6F.10104@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4FDEFC6F.10104@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Any better way to access CPUArchState in vl.c? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?utf-8?Q?F=C3=A4rber?= Cc: qemu-devel@nongnu.org, =?utf-8?B?IumZs+mfi+S7uyAoV2VpLVJlbiBDaGVuKSI=?= Hi Andreas, > Poisoned is the "env" variable. You cannot just #include "dyngen-exec.h= " > and expect it to be usable since AREG0 targets don't guarantee it's set > properly (may be NULL even with traditional targets at times). Oops, I miss that point. =20 > CPUArchState should currently be usable in vl.c, you just need explicit > access to it (e.g., a function argument). > Question is, what are you trying to do? In particular, of which CPU > (think SMP) are you trying to print ->some_field? :) Currently we only consider single CPU ARM guest, so there should be onl= y one env we need to take care of. We add some fields into CPUState and want to= print their value when the VM is terminated. For example, --- static void main_loop(void) { do { nonblocking =3D !kvm_enabled() && last_io > 0; last_io =3D main_loop_wait(nonblocking); } while (!main_loop_should_exit()); // print env->some_field1 // print env->some_field2 } --- If we can access env in vl.c directly, it would make the task easier. Regards, chenwj --=20 Wei-Ren Chen (=E9=99=B3=E9=9F=8B=E4=BB=BB) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667 Homepage: http://people.cs.nctu.edu.tw/~chenwj