public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Sergei Gavrikov <sergei.gavrikov@gmail.com>
To: "Smith, Keith" <Keith.Smith@PERKINELMER.COM>
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] Issue with PSIM
Date: Sat, 23 Apr 2011 09:33:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.00.1104231158470.6528@sg-laptop> (raw)
In-Reply-To: <501B5326BE25CC4A9161C264148D5E3901D9591F@AMERMAIL02.PERKINELMER.NET>

On Fri, 22 Apr 2011, Smith, Keith wrote:

> I am attempting to use the PowerPC simulator with an eCos configuration.
> 
> I have successfully (I think) built a version of gdb to support the psim
> target.

Hi

If you do not sure, first try GNU toolchain from eCosCentric
ftp://ecos.ecoscentric.com/pub/ecos/gnutools/i386linux/

> I then created a PSIM.ecc file and built the library and tests.

Is there something special in PSIM.ecc? First, just try in a fresh dir

  ecosconfig new psim &&
  ecosconfig tree &&
  make && make tests

> When I try to run a test file in gdb, I get an error '
> core_find_mapping() - access to unmaped address, attach a default map to
> handle'
> 
> $ powerpc-unknown-eabisim-gdb
> ~/PPCSim/PPCSim_install/tests/services/memalloc/common/v3_0/tests/heapte
> st
> 
> . . .
> (gdb) target sim -t gdb
> Connected to the simulator.
> (gdb) load

you have to add a device to ppc device tree

  (gdb) target sim -h

There is the same example in the eCos User Guide
http://ecos.sourceware.org/docs-latest/user-guide/setup-ppc-sim.html

So, your .gdbinit file to run eCos tests would be

  $ cat >.gdbinit << EOF
  set confirm no
  define psim  
   target sim -o '/iobus/pal@0xf0001000/reg 0xf0001000 32'  
   rbreak cyg_test_exit  
   rbreak cyg_assert_fail  
  end 
  psim
  load
  run
  EOF

Example of the GDB session

  $ powerpc-eabi-gdb -q install/tests/kernel/current/tests/thread0 
  Connected to the simulator.
  Breakpoint 1 at 0x5b14: file /home/sg/repo/devo/ecos/packages/infra/current/src/tcdiag.cxx, line 254.
  void cyg_test_exit(void);
  PASS:<Thread 0 OK>
  EXIT:<done>
  
  Breakpoint 1, cyg_test_exit ()
      at /home/sg/repo/devo/ecos/packages/infra/current/src/tcdiag.cxx:254
  254     cyg_test_exit(void)
  (gdb) q


HTH

Sergei

> sim_calls.c:104:
> sim_load(prog=/home/SmithKM/PPCSim/PPCSim_install/tests/service
> s/memalloc/common/v3_0/tests/heaptest, from_tty=1) called
> sim_calls.c:108: sim_load() - first time, create the simulator
> (gdb) break main
> Breakpoint 1 at 0x96e0: file
> /opt/ecos/ecos-3.0/packages/language/c/libc/startup
> /v3_0/src/main.cxx, line 91.
> (gdb) run
> Starting program:
> /home/SmithKM/PPCSim/PPCSim_install/tests/services/memalloc/co
> mmon/v3_0/tests/heaptest
> sim_calls.c:173: sim_create_inferior(start_address=0x241c900, ...)
> gdb-sim.c:1280: sim_fetch_register(regno=176(pc), buf=0x241c5bc)
> sim_calls.c:141: sim_read(mem=0x100, buf=0x241c638, length=4) = 4
> gdb-sim.c:1280: sim_fetch_register(regno=1(r1), buf=0x241c53c)
> gdb-sim.c:1280: sim_fetch_register(regno=190(lr), buf=0x241c53c)
> sim_calls.c:141: sim_read(mem=0x96e0, buf=0x26aafcc, length=4) = 4
> sim_calls.c:153: sim_write(mem=0x96e0, buf=0x269b5c8, length=4) = 4
> sim_calls.c:141: sim_read(mem=0x100, buf=0x241c6a8, length=4) = 4
> sim_calls.c:238: sim_resume(step=0, siggnal=0)
> core_find_mapping() - access to unmaped address, attach a default map to
> handle
> this - addr=0xf000101a nr_bytes=0x1 processor=0x25c7338 cia=0x5084
> 
> 
> I hope I have described my problem in enough detail.
> 
> Keith Smith



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  reply	other threads:[~2011-04-23  9:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-22 18:28 Smith, Keith
2011-04-23  9:33 ` Sergei Gavrikov [this message]
2011-04-25 12:48   ` Smith, Keith

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=alpine.DEB.2.00.1104231158470.6528@sg-laptop \
    --to=sergei.gavrikov@gmail.com \
    --cc=Keith.Smith@PERKINELMER.COM \
    --cc=ecos-discuss@ecos.sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).