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

[oc] gdb




Hi!

I'm working on a gdb-simulator for OR1K.  I have also modified
GNU cc a bit for it to generate the code I want :), i.e., generate
OR1K insns.

To let you all know, here's an example of the program I have 
compiled an tested in the simulator:

int t1(k)
        int k;
{
        return k + 1;
}

void
printf()
{
}

void
__main()
{
}

void
main()
{
        int i = 0, p = 0, c;
        
        for(i = 0; i < 10; i++)
                p = i + 2 + p;
        c = p;

        printf ("t1");

        ((void (*)())0xffffffff)(); // terminate program
}

And here's how it looks in the simulator:

GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=or1-coff".
(gdb) file k
Reading symbols from k...(no debugging symbols found)...done.
(gdb) target sim
Connected to the simulator.
(gdb) load k
Loading section .text, size 0x11c vma 0x0
Allocating 4096 bytes of memory for simulation
Start address 0x50
Transfer rate: 2272 bits in <1 sec.
(gdb) run
Starting program: /usr/home/johryd/src/gdb-4.18/gdb/k 
starting to run at 0x50

Program exited with code 011.

(gdb) sim info

OpenRISC 1000 simulator statistics:
# of cycles       : 29
Register contents:
r00: 00000009  r01: ffffffe4  r02: 00000000  r03: 00000000
r04: ffffffe4  r02: 00000000  r06: 000000ff  r07: 00000000
r08: 00000000  r03: 00000000  r10: 00000000  r11: 000000e4
r12: 00000000  r04: 00000000  r14: 00000000  r15: 00000000
r16: 00000000  r05: 00000000  r18: 00000000  r19: 00000000
r20: 00000000  r06: 00000000  r22: 00000000  r23: 00000000
r24: 00000000  r07: 00000000  r26: 00000000  r27: 00000000
r28: 00000000  r08: 00000000  r30: 00000000  r31: 00000000
PC:  000000ec
(gdb) 


I guess this says you nothing. But anyway, it works. And as soon the
compilers work as it should we have an enviorment to test the code in.

When I have fixed a number of bugs I'll put a binary release (and
source) on the FTP site.

-- 
Johan Rydberg			johan.rydberg@netinsight.net
Net Insight AB, Sweden		direct: +46-8-685 04 17
http://www.netinsight.net	phone:  +46-8-685 04 00
				fax:    +46-8-685 04 20