From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5325 invoked by alias); 10 Jul 2007 10:50:59 -0000 Received: (qmail 5317 invoked by uid 22791); 10 Jul 2007 10:50:58 -0000 X-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,FORGED_RCVD_HELO X-Spam-Check-By: sourceware.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (83.160.170.119) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 10 Jul 2007 10:50:56 +0000 Received: from dijkstra.wildebeest.org ([192.168.1.29]) by gnu.wildebeest.org with esmtp (Exim 4.43) id 1I8DLQ-0000RR-D6 for frysk@sourceware.org; Tue, 10 Jul 2007 12:53:25 +0200 Subject: Instruction breakpoint-stepping testsuite (Was: Breakpoint stepping) From: Mark Wielaard To: frysk@sourceware.org In-Reply-To: <1183573205.3598.157.camel@dijkstra.wildebeest.org> References: <1183573205.3598.157.camel@dijkstra.wildebeest.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-z32LdMrxjHtWkP70j74j" Date: Tue, 10 Jul 2007 10:50:00 -0000 Message-Id: <1184064652.3607.53.camel@dijkstra.wildebeest.org> Mime-Version: 1.0 X-Mailer: Evolution 2.8.3 (2.8.3-2.fc6) X-Spam-Score: -4.4 (----) X-Virus-Checked: Checked by ClamAV on sourceware.org X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2007-q3/txt/msg00061.txt.bz2 --=-z32LdMrxjHtWkP70j74j Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Content-length: 2645 On Wed, 2007-07-04 at 20:20 +0200, Mark Wielaard wrote: > - Testsuite. The best I could come up with for now is TestInstructions > and funit-instructions.c which is a nice little framework for having a > simple assembly instructions labeled in such a way that a 'instruction > address path' can be communicated to the java side so it can do either a > full step through the program or install breakpoints on every > instruction and make sure that every step and/or breakpoint hit takes it > to the right next address. But the assembly part has to be written > completely by hand (and unsurprisingly the simple assembly program > currently used works identically on x86 and x86_64). Trying to reuse the > funit-asm.h generic assembly instructions to make it platform neutral > was really hard especially since the labels used on the C and inline > assembly side have to kept in sync and mixing C defines and asm > statements don't seem to mix very well. Also at the moment it is just > using nops and jmps to keep things simple. I guess that in the end, if > we have real instruction parsers we could try to generate them using > that. Ideas or experiences with setting something up to track individual > instructions and getting the right addresses listed appreciated. I think I know how this can be made way easier. The current setup inserts labels at every instruction. This makes it really hard to combine with the generic funit-asm.h assembly instructions since it introduces 2 layers of macros to write a simple test. And the test has to be marked up fully with the labels and a path through the program that can be checked. But the current setup already shows an easier way to do this. In TestInstructions we already do a full step through the assembly and double check that all the labels are hit in the right order. But this can be turned around. We can first do this full step through the assembly instructions and record all addresses, then we put breakpoints at every instruction that we just past and do another run with the breakpoints inserted that should then run exactly the same as before (except for hitting a breakpoint at every step of course). If we do it that way then we just need the start and end address of the instruction stream and can hopefully completely reuse funit-asm.h as long as the test writer makes sure the program always ends at the same address. I'll try and implement it as above using as much instructions from funit-asm as possible. The only tricky thing is then just coming up with a good/long enough instruction sequence to proof we really handle all those instructions out there. Cheers, Mark --=-z32LdMrxjHtWkP70j74j Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part Content-length: 189 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBGk2SFxVhZCJWr9QwRAgrcAJ9Lz8GLNvwE+oWX5wiHRcCU58+G7QCcDZte 8fYuIvimeQ/nPGHAnLX7iwk= =4qWt -----END PGP SIGNATURE----- --=-z32LdMrxjHtWkP70j74j--