From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2003 invoked by alias); 17 May 2013 21:44:00 -0000 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 Received: (qmail 1976 invoked by uid 89); 17 May 2013 21:43:59 -0000 X-Spam-SWARE-Status: No, score=-9.4 required=5.0 tests=AWL,BAYES_00,KHOP_PGP_SIGNED,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.1 Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 17 May 2013 21:43:58 +0000 Received: from vapier.localnet (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 596DE33E194; Fri, 17 May 2013 21:43:56 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: Re: [WIP] TI msp430 CIO support Date: Fri, 17 May 2013 21:44:00 -0000 User-Agent: KMail/1.13.7 (Linux/3.8.3; KDE/4.6.5; x86_64; ; ) Cc: Kevin Buettner References: <20130516212358.23f3bcdb@mesquite.lan> In-Reply-To: <20130516212358.23f3bcdb@mesquite.lan> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4879470.Qme2AEFUtW"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201305171744.00275.vapier@gentoo.org> X-Virus-Found: No X-SW-Source: 2013-05/txt/msg00703.txt.bz2 --nextPart4879470.Qme2AEFUtW Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-length: 2083 On Friday 17 May 2013 00:23:58 Kevin Buettner wrote: > I don't intend to commit this patch as is, but I wanted to post it > because it provides useful functionality for msp430 programming and > debugging. I have found it very useful for running the GDB test suite > because it provides the necessary functionality for printf() and > write() to work. >=20 > TI has an I/O mechanism used by their compiler and libraries that they > call CIO. In a nutshell, it defines a small number of operations > such as open, close, read, write, plus a few others. Drivers exist at > several levels for implementing this functionality. E.g. there are > a board level drivers that causes I/O to occur against devices on the > board. When the target is connected to a debugger, a debug-based > driver is available which causes I/O to be performed on the host > running GDB (or some other debugger). >=20 > The debugger based driver uses a simple breakpoint driven > implementation. The debugger places a breakpoint on a known location > which is always called when debugger-based I/O is to be performed. > When the breakpoint at that location is hit, the debugger reads the > details of the system call and its parameters from a memory based > buffer. The debugger writes back the output of the system call to the > same buffer. (See my patch for the exact details.) what if you run the simulator w/out a debugger (i.e. ./sim/msp430/run ...) = ?=20=20 seems like the answer is "nothing happens" ? you could have the simulator detect the case when it's running standalone=20 (i.e. not via gdb) and patch the symbols to run a custom insn. maybe hijac= k=20 an opcode that doesn't map to a valid insn and then when your sim hits that= ,=20 see if it's a known cio point. if it isn't, throw an exception like normal= ,=20 else let the simulator process the cio operation itself. you could even have this code run when doing a simulation via gdb and it'll= =20 "just work". but you might want to keep the behavior in that case the same= as=20 if you were running it on real hardware. -mike --nextPart4879470.Qme2AEFUtW 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.17 (GNU/Linux) iQIcBAABAgAGBQJRlqSgAAoJEEFjO5/oN/WB7YMP/2fYAJuihLUdLea6nzfpdywk rn2HasSG2lekdW+km9hQVcD+N/+5OliQ0b3h4eASxZjziA4LU1IUJi7D9giYRHvU ci7OS+gQ3Ky0WuJ8yKohXh8HvgoV4zQX1rsJwBZRgE/FSLH610DfHllw8N5sdjSk yXHwkccMkxq1e4uZGM62sCjJIEzk1iT3rXbRnyikIsX69AHnaWBHbZ/C8P6NxsFu IExhwNZTuRNOvidFOrsmmN5UYfJrcP0fLhS2hVnsQXLkpJqxUHeTq4eyxj/V0ZuT y2h/JSb352Vz770QZVq5yeqbodSviCBERV4UFRDxHqpTIVooFOWGsBuxr1MgbIgs lRXcTfXhYsCGeKRoa7pP+qZO9imWIBQfouhH0n9lYQhUEj39FTFd2V0pLUpicY0q 63IUwPsjsGjUOBAhl/IFovZo7XQNa1srXoBGJuV903MLNfYf04afc1VgkP+BsI07 rAf1OAdyCfNeu2uleo2OikZnzyDrl6kVdalIKOEqUCuHd7z8yLiRfbOCYPXoR/Gq ZDNgG8eJ3pX2ROlEyOcLawHolaO+RTr6ODg/isgQifkhfb+lLWDKmsAdLYzbNk3W IxqQHRTo26YFQcOToaPZBHIJbYIZXYAz3kpWQkUAEbOmLtnLzy920mL6FNs8yKBG VHYZm7f9/SKK2kBMWOUf =2dip -----END PGP SIGNATURE----- --nextPart4879470.Qme2AEFUtW--