This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]