This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
RE: How to build application to run under the ppc simulator?
- From: Vermeulen Jan <Jan dot Vermeulen at siemens dot com>
- To: 'Peter Barada' <pbarada at mail dot wm dot sps dot mot dot com>
- Cc: peter at baradas dot org, gdb at sources dot redhat dot com, Peter dot Barada at motorola dot com
- Date: Thu, 10 Apr 2003 08:02:52 +0200
- Subject: RE: How to build application to run under the ppc simulator?
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