Is there a way to know exactly the address range of both the heap and the stack on an RTEMS application by using gdb? I know there's info proc mappings on Linux, but I don't think RTEMS has a /proc to begin with. Using x to examine memory would be great but I need to know the address range of both.
I know there are some tips in http://www.rtems.org/wiki/index.php/Debugging, but they themselves admit those are really crude estimates.
For the heap you can investigate the
Heap_Controlstructure (defined at cpukit/score/include/rtems/score/heap.h) and the two variables,RTEMS_Malloc_Heapand_Workspace_Area. In particular you seem interested in theHeap_Control.area_beginandHeap_Control.area_endfields. The_Workspace_Areacan be part of the heap or a separate memory region, and it holds the kernel data structures. TheRTEMS_Malloc_Heappoints to the Heap_Control describing the traditional C program heap.For the stack, you can look at the
Thread_Start_informationstructure (defined at cpukit/score/include/rtems/score/thread.h) contained in theThread_Controlassociated with the thread whose stack you want to examine. You can get a pointer to the executing thread with the_Thread_Executingmacro.