From: Pedro Alves <palves@redhat.com>
To: Kent Tong <kent.tong.mo@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: Fwd: disabling NMI rendering breakpoints non-functional?
Date: Wed, 17 Apr 2013 09:36:00 -0000 [thread overview]
Message-ID: <516E6D08.2030409@redhat.com> (raw)
In-Reply-To: <CAKs98dFVhz369xBuiycm3rwVYmXED7EtJGckcAYKNcua7+KiNQ@mail.gmail.com>
On 04/16/2013 03:09 AM, Kent Tong wrote:
>> GDB has no clue of NMI, it just tells the target to set a breakpoint at
>> some address, or to single-step. How qemu implements those things
>> behind the scenes is up to qemu.
>
> Thanks for the reply! I also figured that. But does the breakpoint if it is
> set to a memory address whose content will be overwritten (e.g., loading
> instructions into there)? In the past it worked, but now somehow it has
> stopped working.
Depends on how qemu implements breakpoints. By default, if the target
doesn't support z0 remote protocol packets, then GDB fallsback to implementing
breakpoints by planting architecture-defined breakpoint instructions (on x86
that's trap3/0xcc), and then handling the resulting trap. Naturally it
won't work if the instruction is overwritten. The emulator is free to
implement the z0/Z0 packets to handle setting breakpoints itself as it
sees fit. It could still be by planting 0xcc instructions or by watching
the address that is about to be executed, or through whatever other means
it comes up with to make that scenario work. GDB doesn't care.
--
Pedro Alves
next prev parent reply other threads:[~2013-04-17 9:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAKs98dH7TShpfKe4cctTfbonDOkbS1m5rVZv0_WiXwqhTsW8ug@mail.gmail.com>
2013-04-12 15:44 ` Kent Tong
2013-04-15 14:38 ` Pedro Alves
2013-04-16 2:09 ` Kent Tong
2013-04-17 9:36 ` Pedro Alves [this message]
2013-04-17 9:40 ` Kent Tong
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=516E6D08.2030409@redhat.com \
--to=palves@redhat.com \
--cc=gdb@sourceware.org \
--cc=kent.tong.mo@gmail.com \
/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