Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Vermeulen Jan <Jan.Vermeulen@siemens.com>
To: 'Peter Barada' <peter@baradas.org>
Cc: pbarada@mail.wm.sps.mot.com, gdb@sources.redhat.com
Subject: RE: How to build application to run under the ppc simulator?
Date: Thu, 10 Apr 2003 07:12:00 -0000	[thread overview]
Message-ID: <57FD2C3A246F76438CA6FDAD8FE9F19597E9D7@hrtades7.atea.be> (raw)


> >> 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.
> 
> Yeah, I figured out that I can break at main, but I'm trying to figure
> out why:
> 
> (gdb) tar sim
> Connected to the simulator.
> (gdb) load
> (gdb) p $pc
> $1 = 0
> (gdb) x/i 0x0
> 0x0:	Cannot access memory at address 0x0
> (gdb) 
> 
> So the simulater starts out at 0x0 which doesn't make sense.  Where
> does gdb change its mind and figure out where to start?

After you load the program, the simulator has not been started yet.
('info reg' gives 'No selected frame.')

I think that when you do 'run', the simulator will actually be created at
that moment and will load the $pc with the address which was stated in the
linkerscript with the ENTRY(...) directive. Then it'll jump to the simulated
address.

Anyway, this is just from the top of my hat and I'm not a ppc-sim expert
(a.k.a. coder).

If I'm really struggling with something, I dive into the
gdb-<version>/sim/ppc directory and look at some comments in the code.
 
> BTW, how do I use the 'built-in' serial port in the ppc simulator?

See http://sources.redhat.com/psim/manual/ for more info.


Jan


             reply	other threads:[~2003-04-10  7:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-10  7:12 Vermeulen Jan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-04-10  6:02 Vermeulen Jan
2003-04-10  6:08 ` Peter Barada
2003-04-09  6:33 Vermeulen Jan
2003-04-09  6:21 Vermeulen Jan
2003-04-09 16:14 ` Peter Barada
2003-04-09  4:40 Peter Barada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57FD2C3A246F76438CA6FDAD8FE9F19597E9D7@hrtades7.atea.be \
    --to=jan.vermeulen@siemens.com \
    --cc=gdb@sources.redhat.com \
    --cc=pbarada@mail.wm.sps.mot.com \
    --cc=peter@baradas.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox