source: rtems/doc/FAQ/debug.t @ 07b8f26

4.104.114.84.95
Last change on this file since 07b8f26 was 07b8f26, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 19, 1999 at 10:31:11 PM

New file.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1@c
2@c  COPYRIGHT (c) 1988-1998.
3@c  On-Line Applications Research Corporation (OAR).
4@c  All rights reserved.
5@c
6@c  $Id$
7@c
8
9@chapter Debugging Hints
10
11The questions in this category are hints that can ease debugging.
12
13@section How do I determine how much memory is left?
14
15First there are two types of memory: RTEMS Workspace and Program Heap.
16Both are essentially managed as heaps based on the Heap Manager
17in the RTEMS SuperCore.  The RTEMS Workspace uses the Heap Manager
18directly while the Program Heap is actually based on an RTEMS Region
19from the Classic API.  RTEMS Regions are in turn based on the Heap
20Manager in the SuperCore.
21
22@subsection How much memory is left in the RTEMS Workspace?
23
24An executive workspace overage can be fairly easily spotted with a
25debugger.  Look at _Workspace_Area.  If first == last, then there is only
26one free block of memory in the workspace (very likely if no task
27deletions).  Then do this:
28
29(gdb) p *(Heap_Block *)_Workspace_Area->first
30$3 = {back_flag = 1, front_flag = 68552, next = 0x1e260, previous = 0x1e25c}
31
32In this case, I had 68552 bytes left in the workspace.
33
34@subsection How much memory is left in the Heap?
35
36The C heap is a region so this should work:
37
38(gdb) p *((Region_Control *)_Region_Information->local_table[1])->Memory->first
39$9 = {back_flag = 1, front_flag = 8058280, next = 0x7ea5b4,
40  previous = 0x7ea5b0}
41
42In this case, the first block on the C Heap has 8,058,280 bytes left.
43
Note: See TracBrowser for help on using the repository browser.