qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Andre Pech <andre.pech@gmail.com>
To: a_mulyadi@softhome.net
Cc: qemu-devel@nongnu.org
Subject: Re: Re: [Qemu-devel] [PATCH] Fix to gdb - wrong translation block invalidated when setting gdb breakpoints
Date: Tue, 3 Jan 2006 12:12:22 -0800	[thread overview]
Message-ID: <16af12af0601031212g2ffb9fa0xc1c154aaf8eb46cf@mail.gmail.com> (raw)
In-Reply-To: <200601011510.20548.a_mulyadi@softhome.net>

[-- Attachment #1: Type: text/plain, Size: 2082 bytes --]

Hi Mulyadi,

The problem that you are running into here is that sys_uname has been
replaced by sys_newuname in kernel/sys.c. When I put a breakpoint in this
function, everything works correctly when I run uname in the virtual
machine.

I'm not sure I exactly understand your concern that breakpoints could be
missed. When you set the breakpoint, tb_invalidate_phys_page_range is
called, invalidating the translation block block for the address where you
are placing the breakpoint. At this point, the next time that the address is
hit, translate.c:gen_intermediate_code will have to be called, and the
breakpoint will be hit. Let me know if I've missed something here.

Thanks,
Andre

On 1/1/06, Mulyadi Santosa <a_mulyadi@softhome.net> wrote:
>
> Hello Andre...
>
> > Not a problem. I only started using qemu a month ago, so it took me a
> > while to get oriented in the code and understand what was going on. I
> > must say that I've been really impressed with qemu so far.
>
> There was an interesting case I had found recently. In Linux kernel for
> i386 arch, you will see that sys_uname is placed to return kernel
> version/name. Funny thing is, even if I use your patch (against qemu
> 0.7.1) and I put a breakpoint at sys_uname and issue "uname" at bash
> prompt, the Qemu VM doesn't stop. Can you kindly check it?
>
> NB: Please see target-i386/translate.c, there you will see lines like
> these (around line 6306):
> if (env->nb_breakpoints > 0) {
>             for(j = 0; j < env->nb_breakpoints; j++) {
>                 if (env->breakpoints[j] == pc_ptr) {
>                     gen_debug(dc, pc_ptr - dc->cs_base);
>                     break;
>                 }
>             }
>         }
> What I understand from this code is, VM is stop if breakpoint address
> matches with pc_ptr, which tb->pc and AFAIK that is the start address
> of the translation block. So in other word, in some cases Qemu might
> still miss the breakpoint (does it explain the sys_uname case?) Please
> CMIIW
>
> regards
>
> Mulyadi
>
>

[-- Attachment #2: Type: text/html, Size: 2959 bytes --]

  reply	other threads:[~2006-01-03 20:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-23 19:57 [Qemu-devel] [PATCH] Fix to gdb - wrong translation block invalidated when setting gdb breakpoints Andre Pech
2005-12-28  8:22 ` Mulyadi Santosa
     [not found]   ` <16af12af0512301218k48fecbdcr6ec41640b303689@mail.gmail.com>
2006-01-01  8:10     ` Mulyadi Santosa
2006-01-03 20:12       ` Andre Pech [this message]
2006-01-04 10:29         ` Mulyadi Santosa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16af12af0601031212g2ffb9fa0xc1c154aaf8eb46cf@mail.gmail.com \
    --to=andre.pech@gmail.com \
    --cc=a_mulyadi@softhome.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).