From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6220 invoked by alias); 15 Dec 2010 18:38:49 -0000 Received: (qmail 6209 invoked by uid 22791); 15 Dec 2010 18:38:48 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 15 Dec 2010 18:38:44 +0000 Received: from vapier.localnet (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 13DD21B4103; Wed, 15 Dec 2010 18:38:42 +0000 (UTC) From: Mike Frysinger To: Pedro Alves Subject: Re: [PATCH v3] gdb: bfin: new port Date: Wed, 15 Dec 2010 18:38:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.37-rc5; KDE/4.5.2; x86_64; ; ) Cc: gdb-patches@sourceware.org, toolchain-devel@blackfin.uclinux.org References: <1291886957-12003-1-git-send-email-vapier@gentoo.org> <201012151207.12141.vapier@gentoo.org> <201012151800.52772.pedro@codesourcery.com> In-Reply-To: <201012151800.52772.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart38018589.yzT7xDGx8u"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201012151337.50327.vapier@gentoo.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-12/txt/msg00313.txt.bz2 --nextPart38018589.yzT7xDGx8u Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-length: 2603 On Wednesday, December 15, 2010 13:00:27 Pedro Alves wrote: > On Wednesday 15 December 2010 17:07:11, Mike Frysinger wrote: > > > It all looks like you should really make the PC and the CC registers > > > pseudo registers handled by gdb, and not pass them on the remote > > > protocol wire, getting rid of all the possibility of confusing > > > out-of-sync iret/pc, astat/cc. > >=20 > > the trouble with PC is that it isnt always RETI. with a Linux userspace > > app, the PC is managed indirectly via RETI (by nature of the sequencer). > > but this all depends on the level the remote stub is operating at. it > > could possibly be indirectly handled by RETX or RETN or RETE as well. > > so i think the PC > > logic needs to be left up to the remote stub to properly manage. i dont > > think we need to worry about people attempting to screw with any of the > > supervisor level registers (RET[IXNE]) because they arent allowed to in > > usermode and they make no sense unless you're in any of those contexts > > (interrupt/exception/nmi/emulation). >=20 > I see. Does the correct pc register depend on context (in exception, in > interrupt, in normal code, in whatnot), or is it always fixed per stub? = If > the latter, it sounds like something that should be handled by a xml targ= et > description that somehow tells gdb which register is the pc (sounds more > complicated than it is, I think). If the former, is there any way to tell > which is the correct register by reading some other register, perhaps? > Otherwise, yeah, best keep it a separate register, which is a bit of a > shame... in practice, i think the reg would be fixed per stub, but there isnt a=20 requirement for it to be. in the Linux case, the userspace PC often shuffles between all the register= s,=20 and eventually shoves it into RETI (due to how the kernel resumes user mode= =20 from supervisor mode). userspace doesnt actually know about this ... it=20 merely asks via ptrace for the PT_PC register. changing things in the kern= el=20 could break this assumption (RETI =3D=3D PC), but the ABI would be preserve= d since=20 we have the PT_PC indirection. conceivably, a stub operating in a higher mode could pick it from the right= =20 register immediately rather than doing the delayed loading seen in the linu= x=20 kernel. the Blackfin simulator actually does have a dedicated PC register, so in th= at=20 case the request is fulfilled from that source. having the stub export the indirect logic on the fly might be possible, but= =20 i'm not sure the extra complication required is an improvement. -mike --nextPart38018589.yzT7xDGx8u Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. Content-length: 836 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) iQIcBAABAgAGBQJNCQr+AAoJEEFjO5/oN/WBV7UP/i/HVewYFN55eFNLOydQPGhx oawePcT7j5kEUVxd5D9AgR3bD+/737E6WTo4QWWc7BjXAWpHkpdGcG7O5mOh7ke8 FEFuJ3uGLMY0rOUAuS/ouZx1dSlIZVz2o5D0LMy078PuMqCpSpkCllRkzyS1RLyJ UyL0XHUxrt37uAOJXbtq9AAO3LIJoeo2cWh8mnGlYkA7bVSXMtHyL3OtjcTpQ97y BG1MaDxc68xnbAovg42j72xRMYdJXixAqNeZUGhE8tLfEh3SbsPMga/HPaRDNz/E iJj6gvIp/LAyqtWtBNPY5Z/QteuQXhpxFnmcwEZzfc5w8EJJQG7pyfsFVjFJs3wb YBKRArBVyioWKl+uA1SoDW61ezA8qwBWiV5Hk+vKMy9n/5S1E+QdKPkZjL1kfyyy 8mhLGYUvnhFZFSBVHCSJTCKIvz4iTWDti66fXmZrhtf7Fc1N7AfEXnngSvgK+0K9 YAy5WSQDBK3wqD8vJ0AzfCJpkDWLwqT38UE6iXKpbMTqnc7Y+MiJPXt8OG66J4YN Xzyug+pZK96bFKNWs5uigwvnR74YV1Ki6zfxQ552TA5SQtK/68tsrJY8dq1uFUpF eBE9nZXwGxkzwOUG/Zc48LnTOeCa613l2aoLtuqhXbhPCC/sdbwRUHbcAcK+ra5G F8GMzr//8eJ+NiuYTRo3 =qJu0 -----END PGP SIGNATURE----- --nextPart38018589.yzT7xDGx8u--