From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <3f677b626b655cd2835ac3c1d3750549@gmx.de> To: 9fans@9fans.net Date: Sat, 17 Jul 2010 18:48:53 +0200 From: cinap_lenrek@gmx.de In-Reply-To: <4C41D2A6.7080402@bouyapop.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-ulrkthbcthfcxhrnboukvixnws" Subject: Re: [9fans] acid question Topicbox-Message-UUID: 4010d870-ead6-11e9-9d60-3106f5b1d025 This is a multi-part message in MIME format. --upas-ulrkthbcthfcxhrnboukvixnws Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit accedently hit Post... ignore the previous mail. nice trick by the way. -- cinap --upas-ulrkthbcthfcxhrnboukvixnws Content-Type: message/rfc822 Content-Disposition: inline Return-Path: <9fans-bounces+cinap_lenrek=gmx.de@9fans.net> Delivered-To: GMX delivery to cinap_lenrek@gmx.de Received: (qmail invoked by alias); 17 Jul 2010 15:58:34 -0000 Received: from gouda.swtch.com (EHLO gouda.swtch.com) [67.207.142.3] by mx0.gmx.net (mx103) with SMTP; 17 Jul 2010 17:58:34 +0200 Received: from localhost ([127.0.0.1] helo=gouda.swtch.com) by gouda.swtch.com with esmtp (Exim 4.69) (envelope-from <9fans-bounces@9fans.net>) id 1Oa9kW-0002V2-3w; Sat, 17 Jul 2010 15:56:24 +0000 Received: from 27.mail-out.ovh.net ([91.121.30.210]) by gouda.swtch.com with smtp (Exim 4.69) (envelope-from ) id 1Oa9kU-0002Ux-NW for 9fans@9fans.net; Sat, 17 Jul 2010 15:56:22 +0000 Received: (qmail 32763 invoked by uid 503); 17 Jul 2010 15:58:04 -0000 Received: from b7.ovh.net (HELO mail190.ha.ovh.net) (213.186.33.57) by 27.mail-out.ovh.net with SMTP; 17 Jul 2010 15:58:03 -0000 Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 17 Jul 2010 17:56:21 +0200 Received: from arennes-553-1-69-66.w81-250.abo.wanadoo.fr (HELO ?192.168.1.12?) (xigh%bouyapop.org@81.250.184.66) by ns0.ovh.net with SMTP; 17 Jul 2010 17:56:20 +0200 Message-ID: <4C41D2A6.7080402@bouyapop.org> Date: Sat, 17 Jul 2010 17:56:22 +0200 From: Philippe Anel User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.4) Gecko/20100608 Thunderbird/3.1 MIME-Version: 1.0 To: 9fans@9fans.net References: <16b49e4e76df857990ac9dedae73c171@9netics.com> <4C41C578.5080007@bouyapop.org> In-Reply-To: <4C41C578.5080007@bouyapop.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Ovh-Tracer-Id: 15178256645734438168 X-Ovh-Remote: 81.250.184.66 (arennes-553-1-69-66.w81-250.abo.wanadoo.fr) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|U 0.5/N Subject: Re: [9fans] acid question X-BeenThere: 9fans@9fans.net X-Mailman-Version: 2.1.10 Precedence: list Reply-To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.9fans.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: 9fans-bounces@9fans.net Errors-To: 9fans-bounces+cinap_lenrek=gmx.de@9fans.net X-GMX-Antivirus: 0 (no virus found) X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=5D7Q89H36p4WX0t+AtsdW2ORvUlAfcdSIdQlIL3FTSFQDxQiodii41fjuqHQd8jenp0+N dNY0CcAB8WAv7r3OtvsaDOOiC4T8TWFW3c0h9kbMpE0/ou/MWvK8X//VR9J5RqCotAZER8h4O06e mC19Q==V1; X-Flags: 0000 X-GMX-UID: YpUnJkVSaHI+OoUVhSUlVcBqamdhZITw This one sounds like to work (except it does not save registers) ... defn call(addr) { local pco; // we need stack space, and thus process stopped. if status(pid) != "Stopped" then { print("Waiting...\n"); stop(pid); } // Backup orginal instruction pco = fmt(*PC, bpfmt); // Put a temporary breakpoint **PC = bpinst; // update stack pointer *SP = *SP - 4; // make called function returning to this point **SP = *PC; // set PC to function to call *PC = addr; // do the call startstop(pid); // restore original instruction *PC = pco; } Phil; --upas-ulrkthbcthfcxhrnboukvixnws--