From: Davidson Francis <davidsondfgl@gmail.com>
To: Warner Losh <imp@bsdimp.com>
Cc: QEMU Development <qemu-devel@nongnu.org>
Subject: Re: Ideas to Improve GDB Stub in Qemu for i8086
Date: Thu, 19 Dec 2024 21:34:26 -0300 [thread overview]
Message-ID: <20241220003426.GA2475@darkstar> (raw)
In-Reply-To: <CANCZdfodkH0Mf8jkxs3Gybh8-nOAm79X+QXrbAvo0RHR9tBfXg@mail.gmail.com>
On Thu, Dec 19, 2024 at 09:51:13AM -0700, Warner Losh wrote:
> I might be interested in debugging some i8086 stuff for my Venix/86
> emulation
> project.
>
> I'm curious, though. I see special cases just for EIP being returned as (CS
> << 4):EIP
> and similar for ESP being just (SS << 4):SP. What does the debugger do,
> though,
> for other cases where you need segment:offset addresses? Does it translate
> properly
> behind the scenes in ways it doesn't do for ESP/EIP or do you have to
> examine those
> addresses by hand as well? If I'm chasing a linked list with 16-bit
> addresses that assume
> a particular DS, how does that work?
>
You've brought up a very interesting point. Indeed, in the case of
linked lists and similar structures, there’s no way for GDB or QEMU to
reliably determine which segment an address might belong to—perhaps
only guesses, which are far from ideal.
That said, the approach I'm proposing doesn’t solve all problems and
still requires users to handle these conversions manually or through GDB
scripts.
The main goal of my idea is simply to reduce the initial effort required
to debug i8086 code, avoiding workarounds with architecture XML files,
and proper instruction disassembly and stack dumps out-of-the-box.
Kind regards,
Davidson Francis.
next prev parent reply other threads:[~2024-12-20 0:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-19 1:35 Ideas to Improve GDB Stub in Qemu for i8086 Davidson Francis
2024-12-19 16:51 ` Warner Losh
2024-12-20 0:34 ` Davidson Francis [this message]
2024-12-20 11:14 ` Bernhard Beschow
2024-12-21 5:45 ` [PATCH] target/i386: Improve 16-bit/real mode debug support in GDB Davidson Francis
2025-03-07 19:26 ` Bernhard Beschow
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=20241220003426.GA2475@darkstar \
--to=davidsondfgl@gmail.com \
--cc=imp@bsdimp.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.