Changeset 71f4beb in rtems for c/src/libmisc/stackchk
- Timestamp:
- 04/15/98 15:08:49 (26 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- d07d3eec
- Parents:
- 9b64c2d5
- Location:
- c/src/libmisc/stackchk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/libmisc/stackchk/README
r9b64c2d5 r71f4beb 2 2 # $Id$ 3 3 # 4 5 Introduction 6 ============ 4 7 5 8 This directory contains a stack bounds checker. It provides two … … 8 11 + check for stack overflow at each context switch 9 12 + provides an educated guess at each task's stack usage 13 14 Enabling 15 ======== 16 17 Add the stack checker extension to the initial user extension set. 18 If using confdefs.h to build your configuration table, this is 19 as simple as adding -DSTACK_CHECK_ON to the gcc command line which 20 compiles the file defining the configuration table. In the RTEMS 21 test suites and samples, this is always init.c 22 23 Background 24 ========== 10 25 11 26 The stack overflow check at context switch works by looking for -
c/src/libmisc/stackchk/check.c
r9b64c2d5 r71f4beb 176 176 }; 177 177 178 #if 0 178 179 status = rtems_extension_create( 179 180 rtems_build_name( 'S', 'T', 'C', 'K' ), … … 182 183 ); 183 184 assert ( status == RTEMS_SUCCESSFUL ); 185 #endif 184 186 185 187 Stack_check_Blown_task = 0; … … 255 257 ) 256 258 { 259 if (!stack_check_initialized) 260 Stack_check_Initialize(); 261 257 262 if (the_thread /* XXX && (the_thread != _Thread_Executing) */ ) 258 263 stack_check_dope_stack(&the_thread->Start.Initial_stack); … … 271 276 { 272 277 Stack_check_Control *the_pattern; 278 279 if (!stack_check_initialized) 280 Stack_check_Initialize(); 273 281 274 282 if ( the_thread->Object.id == 0 ) /* skip system tasks */ -
c/src/libmisc/stackchk/stackchk.h
r9b64c2d5 r71f4beb 34 34 void Stack_check_Dump_usage( void ); 35 35 36 /* 37 * Stack_check_Create_extension 38 */ 39 40 boolean Stack_check_Create_extension( 41 Thread_Control *running, 42 Thread_Control *the_thread 43 ); 44 45 /* 46 * Stack_check_Begin_extension 47 */ 48 49 void Stack_check_Begin_extension( 50 Thread_Control *the_thread 51 ); 52 53 /* 54 * Stack_check_Switch_extension 55 */ 56 57 void Stack_check_Switch_extension( 58 Thread_Control *running, 59 Thread_Control *heir 60 ); 61 62 /* 63 * Extension set definition 64 */ 65 66 #define STACK_CHECKER_EXTENSION \ 67 { \ 68 Stack_check_Create_extension, /* rtems_task_create */ \ 69 0, /* rtems_task_start */ \ 70 0, /* rtems_task_restart */ \ 71 0, /* rtems_task_delete */ \ 72 Stack_check_Switch_extension, /* task_switch */ \ 73 Stack_check_Begin_extension, /* task_begin */ \ 74 0, /* task_exitted */ \ 75 0 /* Stack_check_Fatal_extension */, /* fatal */ \ 76 } 77 36 78 #ifdef __cplusplus 37 79 }
Note: See TracChangeset
for help on using the changeset viewer.