From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18897 invoked by alias); 6 May 2010 15:30:25 -0000 Received: (qmail 18879 invoked by uid 22791); 6 May 2010 15:30:24 -0000 X-SWARE-Spam-Status: No, hits=-5.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 06 May 2010 15:30:18 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o46FU9bP018123 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 6 May 2010 11:30:09 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o46FU6qV005854 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 6 May 2010 11:30:08 -0400 Message-ID: <4BE2E07E.3000409@redhat.com> Date: Thu, 06 May 2010 15:30:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.4 MIME-Version: 1.0 To: vincent chen CC: insight@sourceware.org Subject: Re: how to port insight to a new target References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact insight-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sourceware.org X-SW-Source: 2010-q2/txt/msg00015.txt.bz2 On 05/06/2010 03:33 AM, vincent chen wrote: > I have ported GDB by adding a new target in sim,and the gdb appears to > run properly on simulator. You've already got most of the work done, then. > I've no idea about which start by,it's better to show me the approach > on porting insight, Unfortunately, there is no documentation on how to do this, so you're just gong to have to tackle the problems one-by-one. Honestly, this sholudn't take very long at all. The most important thing to do is add your target to the target database in TargetSelection::init_target_db (src/gdb/gdbtk/library/targetselection.itb). If your -tdep file is written correctly, that should be all that is necessary. However, there are usually some minor problems. One of the most common is that insight doesn't notice that the target is "running" (the toolbar buttons Run/Stop, Step, Next, etc are all disabled/grayed out). This happens because the test "gdb_target_has_execution" fails (in Tcl). This command is implemented in src/gdb/gdbtk/generic/gdbtk-cmds.c in the function "gdb_target_has_execution_command". remote.c should contain bits of this that will demonstrate how to pass this test. The only other thing that usually crops up is that while the target is running, the GUI locks up. This is because the (deprecated_)ui_loop_hook isn't being called to allow the Tcl event loop to run. [A sad consequence of the design of gdb at the time.] Make sure this function gets called at reasonable intervals in your simulator. Other simulators in the repository should already do this. Of course, if there are any other problems, just send them to the list, and I'll try to help you through them. Good luck, Keith