From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2630 invoked by alias); 14 Nov 2003 07:43:48 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 2621 invoked from network); 14 Nov 2003 07:43:47 -0000 Received: from unknown (HELO gum.itee.uq.edu.au) (130.102.66.1) by sources.redhat.com with SMTP; 14 Nov 2003 07:43:47 -0000 Received: from nut.itee.uq.edu.au (nut.itee.uq.edu.au [130.102.66.13]) by gum.itee.uq.edu.au (8.12.10/8.12.9) with ESMTP id hAE7hXEq009845; Fri, 14 Nov 2003 17:43:34 +1000 (EST) Received: from itee.uq.edu.au (remote.itee.uq.edu.au [130.102.79.253]) by nut.itee.uq.edu.au (8.12.10/8.12.9) with ESMTP id hAE7hVSq004220; Fri, 14 Nov 2003 17:43:32 +1000 (EST) Message-ID: <3FB487B4.5010107@itee.uq.edu.au> Date: Fri, 14 Nov 2003 07:43:00 -0000 From: John Williams User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.5) Gecko/20030925 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Rama Singh CC: gdb@sources.redhat.com Subject: Re: GDB interface with simulator References: <20031114071511.26663.qmail@web8005.mail.in.yahoo.com> In-Reply-To: <20031114071511.26663.qmail@web8005.mail.in.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checked: This message probably not SPAM X-Spam-Score: -2.1 X-Spam-Tests: EMAIL_ATTRIBUTION,IN_REP_TO,ITEE_DISCREDITED_SENDER,REFERENCES,REPLY_WITH_QUOTES,USER_AGENT_MOZILLA_UA,X_ACCEPT_LANG X-Spam-Report: -2.10 points, 8 required; * -0.5 -- Has a valid-looking References header * -0.5 -- Has a In-Reply-To header * 0.0 -- User-Agent header indicates a non-spam MUA (Mozilla) * 0.0 -- Sender has sent many messages to invalid ITEE addresses * -0.1 -- Has a X-Accept-Language header * -0.5 -- BODY: Contains what looks like an email attribution * -0.5 -- Reply with quoted text X-Scanned-By: MIMEDefang 2.35 X-SW-Source: 2003-11/txt/msg00100.txt.bz2 Hi Rama, Rama Singh wrote: > I am working on a cycle accurate simulator and for the > purpose of debugging application, I wish to use gdb. > Now gdb has in build support for about a dozen most > popular simulators. It interacts with the simulator as > a library. I wish to use my simulator as an > independent process running on the same machine or on > other machine. > Is it posible to have gdb interact with a simulator > over a socket? Also where can I find more information > on this? I believe that implementing this will involve > writing a gdb stub that will compile with the > application and thus interact with the host gdb. Am I > getting things correctly or is there some other > possible way too? Take a look at the gdbserver application, distributed with GDB. Speifically, the remote-utils.c file will show you the socket interface, and provide some tips on how to implement it. You basically just implement stubs to read/write memory, query registers, set breakpoints, that sort of thing. Then, read http://sources.redhat.com/gdb/current/onlinedocs/gdb_33.html to see the format of the remote debugging packets. You might just be able to integrate the gdbserver application into your simulator. Good luck, John