From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HX5xF-0000JX-3L for qemu-devel@nongnu.org; Thu, 29 Mar 2007 21:31:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HX5xD-0000Ic-PK for qemu-devel@nongnu.org; Thu, 29 Mar 2007 21:31:00 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HX5xD-0000IZ-FR for qemu-devel@nongnu.org; Thu, 29 Mar 2007 20:30:59 -0500 Received: from wx-out-0506.google.com ([66.249.82.239]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HX5uZ-000819-7d for qemu-devel@nongnu.org; Thu, 29 Mar 2007 21:28:15 -0400 Received: by wx-out-0506.google.com with SMTP id i30so541967wxd for ; Thu, 29 Mar 2007 18:28:14 -0700 (PDT) Message-ID: <12835c8f0703291828y31e5b962i7a52527b8db63a98@mail.gmail.com> Date: Thu, 29 Mar 2007 18:28:14 -0700 From: "Shashidhar Mysore" Subject: Re: [Qemu-devel] Re: PC traces from QEMU In-Reply-To: <20070329203736.GA7024@miranda.arrow> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_33081_4507417.1175218094887" References: <12835c8f0703261313j45f7e23cx1773a20845370a4e@mail.gmail.com> <87ejn80xi8.fsf@brigitte.dna.fi> <20070329203736.GA7024@miranda.arrow> 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, sdbrady@ntlworld.com ------=_Part_33081_4507417.1175218094887 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Stuart, Thanks for the reply, but since I'm a little new to qemu, can you please elaborate on how to insert the op_dump_pc function to extract the PC values? Thanks, -Shashi. On 3/29/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. > > Cheers, > -- > Stuart Brady > > > ------=_Part_33081_4507417.1175218094887 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Stuart,

Thanks for the reply, but since I'm a little new to qemu, can you please elaborate on how to insert the op_dump_pc function to extract the PC values?

Thanks,
-Shashi.

On 3/29/07, Stuart Brady <sdbrady@ntlworld.com> wrote:
On Thu, Mar 29, 2007 at 08:29:03PM +0300, Antti P Miettinen wrote:
> "Shashidhar Mysore" <shashimc@gmail.com> 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.

Cheers,
--
Stuart Brady



------=_Part_33081_4507417.1175218094887--