From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M0plI-0002IL-8S for qemu-devel@nongnu.org; Mon, 04 May 2009 00:26:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M0plD-0002I8-Rj for qemu-devel@nongnu.org; Mon, 04 May 2009 00:26:39 -0400 Received: from [199.232.76.173] (port=46917 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M0plD-0002I5-MT for qemu-devel@nongnu.org; Mon, 04 May 2009 00:26:35 -0400 Received: from rv-out-0708.google.com ([209.85.198.248]:55767) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M0plD-00034D-CW for qemu-devel@nongnu.org; Mon, 04 May 2009 00:26:35 -0400 Received: by rv-out-0708.google.com with SMTP id c5so2397279rvf.22 for ; Sun, 03 May 2009 21:26:33 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <75019235-14F9-4791-8E7F-85581D46B106@few.vu.nl> References: <75019235-14F9-4791-8E7F-85581D46B106@few.vu.nl> Date: Mon, 4 May 2009 11:26:33 +0700 Message-ID: Subject: Re: [Qemu-devel] Logging instructions in single step mode From: Mulyadi Santosa Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Remco Vermeulen Cc: qemu-devel@nongnu.org Hi Remco... It's been awhile since I did brief pre-TCG qemu code analysis, but here's my thought... On Sat, May 2, 2009 at 2:39 AM, Remco Vermeulen wrote: > Hello everyone, > > I'm currently working on modification where I would like to log the > instructions executed when the cpu is in single step mode. Since the > current_tb is null, probably because the cpu is in single step mode I can't > use that tb. > I could access the memory pointed to by the instruction pointer, but I don't > know the length of the instruction. How about checking disas_insn() in target-i386/translate.c ? I think no matter what the current mode is (non single step or not), in some ways this function should be called. About checking the length of the instruction, i can not give too many thoughts here. However, in the same function, probably you can mimic how Qemu does code analysis. regards, Mulyadi.