From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamie Lokier Subject: Re: [Qemu-devel] Re: gdbstub: packet reply is too long Date: Sat, 3 Jan 2009 01:53:07 +0000 Message-ID: <20090103015307.GA1927@shareable.org> References: <1229776952.22890.2.camel@ws-aschultz> <200812202208.34044.paul@codesourcery.com> <494D72E1.6020104@web.de> <200812202246.39036.paul@codesourcery.com> <494D8344.8010203@web.de> <20081226233012.GA9221@caradoc.them.org> <4958E5A7.4000303@web.de> <20081230224302.GA30049@caradoc.them.org> <495E0E65.9040205@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Daniel Jacobowitz , Andreas Schultz , kvm@vger.kernel.org, Paul Brook To: qemu-devel@nongnu.org Return-path: Received: from mail2.shareable.org ([80.68.89.115]:32955 "EHLO mail2.shareable.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755528AbZACBxQ (ORCPT ); Fri, 2 Jan 2009 20:53:16 -0500 Content-Disposition: inline In-Reply-To: <495E0E65.9040205@web.de> Sender: kvm-owner@vger.kernel.org List-ID: Jan Kiszka wrote: > You need CR0.PE to detect if you are in real or protected mode. And then > you need GDTR/LDTR to find the descriptor CS is pointing at, parsing it > to detect if you are running 16, 32 or 64 bit code (by default). Those > extensions would also be useful in order to decode memory addresses in > case descriptor.base != 0 (or if it's CS >> 4, ie. you are in real > mode). If you're going to decode segment descriptors (great idea, btw, and helpful for threaded code), it might be better to supply the CPU's internal segment state, if that's possible, instead of looking at the LDT/GDT in memory, since the CPU's state can differ from the memory version when the latter is written to. -- Jamie