From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HX2Qs-0000ww-B4 for qemu-devel@nongnu.org; Thu, 29 Mar 2007 17:45:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HX2Qq-0000sV-2s for qemu-devel@nongnu.org; Thu, 29 Mar 2007 17:45:21 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HX2Qp-0000sS-W7 for qemu-devel@nongnu.org; Thu, 29 Mar 2007 16:45:20 -0500 Received: from wr-out-0506.google.com ([64.233.184.238]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HX2OC-00058r-VG for qemu-devel@nongnu.org; Thu, 29 Mar 2007 17:42:37 -0400 Received: by wr-out-0506.google.com with SMTP id i20so665119wra for ; Thu, 29 Mar 2007 14:42:35 -0700 (PDT) Message-ID: Date: Thu, 29 Mar 2007 23:42:35 +0200 From: "andrzej zaborowski" Sender: balrogg@gmail.com Subject: Re: [Qemu-devel] Re: PC traces from QEMU In-Reply-To: <20070329203736.GA7024@miranda.arrow> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <12835c8f0703261313j45f7e23cx1773a20845370a4e@mail.gmail.com> <87ejn80xi8.fsf@brigitte.dna.fi> <20070329203736.GA7024@miranda.arrow> Reply-To: balrogg@gmail.com, 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 On 29/03/07, Stuart Brady wrote: > On Thu, Mar 29, 2007 at 08:29:03PM +0300, Antti P Miettinen wrote: > > "Shashidhar Mysore" writes: > > > I intend to extract program counter streams from QEMU as a program executes. > > > Can you please point me to the hooks that I may have to insert into the QEMU > > > source code in order to extract the PC values? > > > > I used to do that with qemu 0.7. I did not dig into this deep enough > > to find the minimal changes but at least the following was enough: > [...] > > - force dc->jmp_opt to zero in target-i386/translate.c > > I don't quite see where you would do this. > > BTW, the approach I took was to add something like gen_op_dump_pc(s->pc) > near the top of disas_insn (in translate.c), and have op_dump_pc (in > op.c) pass the program counter (held in PARAM1) to a helper (in > helper.c) that then prints it out. I expect that's not the best > approach, but it worked quite well for my purposes. The approach I took was call "cpu_single_step(env, 1); vm_start(); return;" in gdb_vm_stopped in gdbstub.c. Then after I connect to qemu with gdb the first time it single steps in a loop - probably very inefficient but works. Just my two cents. Andrzej