From: Eddie Kohler <kohler@cs.ucla.edu>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] PATCH: allow i386 debugging when segment offset != 0
Date: Thu, 06 Mar 2008 14:50:19 -0800 [thread overview]
Message-ID: <47D0752B.8080807@cs.ucla.edu> (raw)
Hi all,
This patch makes QEMU's gdb debugging stub and CPU breakpoints work when
the segment offset is not 0.
Previously, the debugging stub assumed the segment offset was 0, leading
to very odd behavior.
This patch assumes that the code segment and data segment have the same
offset. This is a reasonable assumption. Making the code work for
different code and data offsets would be more invasive.
Please accept this patch (this is a resend.)
Eddie Kohler
Index: target-i386/helper2.c
===================================================================
RCS file: /sources/qemu/qemu/target-i386/helper2.c,v
retrieving revision 1.62
diff -u -r1.62 helper2.c
--- target-i386/helper2.c 24 Dec 2007 14:04:06 -0000 1.62
+++ target-i386/helper2.c 6 Mar 2008 22:46:46 -0000
@@ -1081,6 +1081,7 @@
{
uint32_t pde_addr, pte_addr;
uint32_t pde, pte, paddr, page_offset, page_size;
+ addr += env->segs[R_DS].base;
if (env->cr[4] & CR4_PAE_MASK) {
uint32_t pdpe_addr, pde_addr, pte_addr;
Index: target-i386/translate.c
===================================================================
RCS file: /sources/qemu/qemu/target-i386/translate.c,v
retrieving revision 1.79
diff -u -r1.79 translate.c
--- target-i386/translate.c 24 Feb 2008 07:45:42 -0000 1.79
+++ target-i386/translate.c 6 Mar 2008 22:46:46 -0000
@@ -6740,7 +6740,7 @@
for(;;) {
if (env->nb_breakpoints > 0) {
for(j = 0; j < env->nb_breakpoints; j++) {
- if (env->breakpoints[j] == pc_ptr) {
+ if (env->breakpoints[j] == pc_ptr - dc->cs_base) {
gen_debug(dc, pc_ptr - dc->cs_base);
break;
}
reply other threads:[~2008-03-06 22:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=47D0752B.8080807@cs.ucla.edu \
--to=kohler@cs.ucla.edu \
--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).