From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55536) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sgv9I-00078y-1c for qemu-devel@nongnu.org; Tue, 19 Jun 2012 05:55:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sgv9B-00030U-Pd for qemu-devel@nongnu.org; Tue, 19 Jun 2012 05:54:59 -0400 Received: from cantor2.suse.de ([195.135.220.15]:39133 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sgv9B-00030I-Jp for qemu-devel@nongnu.org; Tue, 19 Jun 2012 05:54:53 -0400 Message-ID: <4FE04C66.2070203@suse.de> Date: Tue, 19 Jun 2012 11:54:46 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <20120618074756.GA47810@cs.nctu.edu.tw> <4FDEFC6F.10104@suse.de> <20120619090230.GA39361@cs.nctu.edu.tw> In-Reply-To: <20120619090230.GA39361@cs.nctu.edu.tw> Content-Type: text/plain; charset=UTF-8 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: =?UTF-8?B?IumZs+mfi+S7uyAoV2VpLVJlbiBDaGVuKSI=?= Cc: qemu-devel@nongnu.org Hi, Am 19.06.2012 11:02, schrieb =E9=99=B3=E9=9F=8B=E4=BB=BB (Wei-Ren Chen): >> Question is, what are you trying to do? In particular, of which CPU >> (think SMP) are you trying to print ->some_field? :) >=20 > Currently we only consider single CPU ARM guest, so there should be o= nly 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, >=20 > --- > 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()); >=20 > // print env->some_field1 > // print env->some_field2 > } > --- >=20 > If we can access env in vl.c directly, it would make the task easier. If you only have one CPU then using first_cpu->some_field1 should be almost as easy. :) Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg