[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [openrisc] or32 compile errors




    The problem is with libraries... You are actually trying to build
    application for rtems OS.
    I am not aware what is the status with RTEMS and building 
    applications for it (Ivan and Chris were working on it).
    Maybe you will need some extra steps like with building
    uClinux tools. Look at web how you can build the utils for uClinux.

Thanks, I understand now.  I am just trying to learn how to use the or1k
simulator with DDD, so I will try your example code.
    
    But if you want just to test the debugger with DDD, you can do
    much simpler example, like:
    (Copied and modified from or1k/or1ksim/testbench; you can find more
    OS independent applications/tests there.
    Note that below example does not use any standard headers, supported
    by OS)

Ok, I put your code into a file called sample1.c.  I compiled it as
follows.  It compiled cleanly.

[jeff@asic1 jeff]$ or32-rtems-gcc -g -o sample1.or32 sample1.c 

Now I open another terminal, and start the or32-rtems-sim.  It has the
jtag debug enabled and set to port 9999.

Now in another terminal, I start DDD as follows:

ddd --debugger /opt/or32-rtems/bin/or32-rtems-gdb

(gdb) file sample1.or32

The source code shows up in the window.

(gdb) target jtag jtag://localhost:9999
Remote or1k debugging using jtag://localhost:9999
0x104 in main () at sample1.c:22

The simulator spewed some MEMWRITE and MEMREAD statements.

(gdb) load
Loading section .text, size 0x370 lma 0x0
Loading section .data, size 0x20 lma 0x370
Start address 0x0 , load size 912
Transfer rate: 7296 bits in <1 sec, 304 bytes/write.
(gdb)

The simulator again spewed a few more MEMREAD lines including the
following:
WRITE (00000010) = 00000000
WARNING: PC just set to 0!
MEMREAD  (000000c4) = 9c21ffe4
MEMREAD  (000000c8) = d4011008
MEMREAD  (ffffffec) = 081001d4
MEMREAD  (00000024) = 44004800

The gdb prompt returned, however, the debugger never recovers.  The busy
light keeps blinking.  The status line says "Disassembling location
0x20..."
I am unable to interupt the debugger.  The machine code window says "No
Code."  I have to kill the debugger and restart it to get the gdb
command line back.  Any suggestions as to what I am doing wrong?

Thanks for any advice
Jeff


--
To unsubscribe from openrisc mailing list please visit http://www.opencores.org/mailinglists.shtml