From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32026 invoked by alias); 26 Feb 2008 01:49:28 -0000 Received: (qmail 31928 invoked by uid 22791); 26 Feb 2008 01:49:28 -0000 X-Spam-Check-By: sourceware.org Received: from bluesmobile.specifix.com (HELO bluesmobile.specifix.com) (216.129.118.140) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 26 Feb 2008 01:49:10 +0000 Received: from [127.0.0.1] (bluesmobile.specifix.com [216.129.118.140]) by bluesmobile.specifix.com (Postfix) with ESMTP id 9B3D93BA09; Mon, 25 Feb 2008 17:49:08 -0800 (PST) Subject: Re: Re: problem with gdb stub compiling From: Michael Snyder To: XCV Cc: gdb@sourceware.org In-Reply-To: <47c36449.16048e0a.4eb0.ffffe024@mx.google.com> References: <47c36449.16048e0a.4eb0.ffffe024@mx.google.com> Content-Type: text/plain Date: Tue, 26 Feb 2008 08:28:00 -0000 Message-Id: <1203990548.19253.300.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-7.fc7) Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-02/txt/msg00217.txt.bz2 On Tue, 2008-02-26 at 08:58 +0800, XCV wrote: > > >On Mon, 2008-02-25 at 20:14 +0800, XCV wrote: > >> hello!i've got a problem while try to run a simple example with i386-stub: > > > >Wow, this stub code is really ancient, and (evidently) not well > >maintained. Overlooking one simple textual patch, the last changelog > >reference is from 2001, nearly 7 years ago. > > > >What's your target? Is it a bare board, without an operating system? > > > >If it's Linux or something, you could probably use gdbserver. > > > Thank you very much for your help!I also noticed that it's a really ancient > code,but what i thaught is it's from GDB standard package so it's must be > a valuable sample. > > In fact ,my target is a subset of MIPS implemented by ourselves ,and we need a stub on this target. The reason why > I try to run the i386-stub (on my x86 pc with linux ) is i want to get a exact correct example to write my > own stub (i'm a beginner on this). > > And our requirement is to debug our OS ,so a stub instead of gdbserver is wanted. > > So ,can you plz advise me? Thank you in advance Cc:ing private response back to public list (hope you don't mind). Well, it is good example code, it's just OLD example code. Hardly anyone uses these linked-in stubs any more (self-evidently). And they've never been treated as part of gdb -- they're only incidentally mentioned in the Makefile, for instance. Probably the most recently-maintained one is m32r-stub.c, which was rewritten (and therefore presumably working) in 2003 -- if that helps you at all. The problem is, these files are mostly incomplete, as you have noticed. They don't implement certain functions such as, in this case, handle_exception, exceptionHook, catchException0 (etc). Those functions would have been implemented separately, in another module called (for instance) i386_rom.c, and those modules were implemented back at the old company (Cygnus) - but we could never figure out where to put them. There was a library called "libgloss", where I think we talked about putting them, but I'm looking in there right now and I don't see them. It's possible this code was never released -- you might have to implement the exception handlers yourself. Just thinking out loud here, trying to dredge up memories from off-line storage... ;-/