From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12692 invoked by alias); 10 Apr 2003 06:02:55 -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 12684 invoked from network); 10 Apr 2003 06:02:54 -0000 Received: from unknown (HELO hrtades9.atea.be) (194.78.143.106) by sources.redhat.com with SMTP; 10 Apr 2003 06:02:54 -0000 Received: from hrtades10.atea.be (siemens.atea.be [139.10.143.141]) by hrtades9.atea.be with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 1RFVN75Z; Thu, 10 Apr 2003 08:02:53 +0200 Received: by siemens.atea.be with Internet Mail Service (5.5.2653.19) id ; Thu, 10 Apr 2003 08:02:53 +0200 Message-ID: <57FD2C3A246F76438CA6FDAD8FE9F19597E9D6@hrtades7.atea.be> From: Vermeulen Jan To: 'Peter Barada' Cc: peter@baradas.org, gdb@sources.redhat.com, Peter.Barada@motorola.com Subject: RE: How to build application to run under the ppc simulator? Date: Thu, 10 Apr 2003 06:02:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-SW-Source: 2003-04/txt/msg00092.txt.bz2 Peter, > >> and it bombs with: > >> > >> >Program terminated with signal SIGSEGV, Segmentation fault. > >> >The program no longer exists. > >> >[Switching to process 0] > >> >(gdb) > > > >This is quite normal, because your program is executed correctly and > >executes an 'blr' instruction at the end of the main > routine. This makes the > >simulated CPU jump to what's currently in the link register, > which can be > >anything. There it will do crazy things untill it finally > segfaults :) > > > >If in doubt, just 'stepi' the program, watching the assembly > be executed. > > I can't stepi from the start, I have to run it. How(actually, > *where*) can I set a breakpoint at the *first* instruction so I can > *then* stepi? If your only function is 'foo', why not try "break foo" at the gdb command? I just tried it out (same example as you) and it works. I can stepi in the program and see that it jumps to 0x0 after the 'blr' instruction at the end of 'foo' where it segfaults. HTH, Jan