[Solved] Configuraing memory size in GDB?

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

[Solved] Configuraing memory size in GDB?

Postby heshamelmatary » Fri Nov 21, 2014 11:20 am

Hi,

I am a research student at the University of York working currently on porting RTEMS [1] to Parallella (epiphany 16 cores) board. Given that I now have epiphany-rtems4.11-* toolchain, I am at the stage of getting Hello world RTEMS application running on epiphany-run and/or epiphany-gdb. As for libgloss, I used write with trap system call to get output to the console (is this the right call > asm_write (STDOUT_FILENO, &c, 1);) ??

I use a linker script to map the program to the external memory from 0x8E000000 to 0x8FFFFFFF. For epiphany-run I can use --memory-region 0x8E000000,16m option. But I have to debug from GDB. When I used GDB with this memory map, I always get unmapped memory. I think GDB is working with local memory only for a single core (please correct)? The question is, how can I configure memory for GDB (i.e, the size, mapping, etc).

[1] https://www.rtems.org/
Last edited by heshamelmatary on Tue Nov 25, 2014 2:06 pm, edited 1 time in total.
-- Hesham
heshamelmatary
 
Posts: 11
Joined: Thu Nov 13, 2014 3:31 pm
Location: UK

Re: Configuraing memory size in GDB?

Postby jeremybennett » Fri Nov 21, 2014 2:18 pm

User avatar
jeremybennett
 
Posts: 61
Joined: Mon Dec 17, 2012 9:06 am

Re: Configuraing memory size in GDB?

Postby heshamelmatary » Fri Nov 21, 2014 2:50 pm

-- Hesham
heshamelmatary
 
Posts: 11
Joined: Thu Nov 13, 2014 3:31 pm
Location: UK

Re: Configuraing memory size in GDB?

Postby jeremybennett » Mon Nov 24, 2014 2:51 pm

Hi Hesham,

I suspect you are pushing the simulator to its limits. It is only a functional simulator of the instruction set, not a full blown system simulator. It's quite likely that clever stuff for operating system ports might break it.

I'll get Joern Rennecke (amylaar) to take a look. He worked on the CGEN simulator.


Jeremy
User avatar
jeremybennett
 
Posts: 61
Joined: Mon Dec 17, 2012 9:06 am

Re: Configuraing memory size in GDB?

Postby amylaar » Mon Nov 24, 2014 3:37 pm

When I worked on making the arc simulator accept program / argument size according to program & input, sizing the memory regions
after the simulator instance was already created was really awkward. It is much easier if you set the sizes & addresses first before creating the
simultor instance, which is what happens with epiphany-run when you tell it the program size/address on the command line.
From the gdb session, I see you didn't specify these numbers (is there even an option for that with epiphany-gdb ?), created the
simulator instance, and then loaded the program.

Specifying the size/address first - adding the option(s) for that if necessary - is likely the easiest soltion in the short term.
amylaar
 
Posts: 31
Joined: Thu Jan 10, 2013 3:06 pm

Re: Configuraing memory size in GDB?

Postby heshamelmatary » Mon Nov 24, 2014 5:27 pm

-- Hesham
heshamelmatary
 
Posts: 11
Joined: Thu Nov 13, 2014 3:31 pm
Location: UK

Re: Configuraing memory size in GDB?

Postby heshamelmatary » Mon Nov 24, 2014 6:08 pm

-- Hesham
heshamelmatary
 
Posts: 11
Joined: Thu Nov 13, 2014 3:31 pm
Location: UK

Re: [Solved] Configuraing memory size in GDB?

Postby heshamelmatary » Tue Nov 25, 2014 2:07 pm

Hi,

I want to save your time with replies, I solved the problem.
It was all about stack location and alignment restrictions.

Thanks a lot for your help.

-- Hesham
-- Hesham
heshamelmatary
 
Posts: 11
Joined: Thu Nov 13, 2014 3:31 pm
Location: UK


Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 11 guests