[ac7d5ef0] | 1 | /* |
---|
[b06e68ef] | 2 | * @(#)symbols.h 1.3 - 95/06/09 |
---|
| 3 | * |
---|
| 4 | * |
---|
| 5 | * RTEMS monitor symbol table functions |
---|
[ac7d5ef0] | 6 | * |
---|
| 7 | * Description: |
---|
| 8 | * Entry points for symbol table routines. |
---|
| 9 | * |
---|
| 10 | * |
---|
| 11 | * |
---|
| 12 | * TODO: |
---|
| 13 | * |
---|
[b06e68ef] | 14 | * $Id$ |
---|
[ac7d5ef0] | 15 | */ |
---|
| 16 | |
---|
| 17 | #ifndef _INCLUDE_SYMBOLS_H |
---|
| 18 | #define _INCLUDE_SYMBOLS_H |
---|
| 19 | |
---|
| 20 | #ifdef __cplusplus |
---|
| 21 | extern "C" { |
---|
| 22 | #endif |
---|
| 23 | |
---|
| 24 | typedef struct { |
---|
| 25 | rtems_unsigned32 value; |
---|
| 26 | char *name; |
---|
| 27 | } rtems_symbol_t; |
---|
| 28 | |
---|
| 29 | #define SYMBOL_STRING_BLOCK_SIZE 4080 |
---|
| 30 | typedef struct rtems_symbol_string_block_s { |
---|
| 31 | struct rtems_symbol_string_block_s *next; |
---|
| 32 | char buffer[SYMBOL_STRING_BLOCK_SIZE]; |
---|
| 33 | } rtems_symbol_string_block_t; |
---|
| 34 | |
---|
| 35 | typedef struct { |
---|
| 36 | |
---|
| 37 | rtems_unsigned32 sorted; /* are symbols sorted right now? */ |
---|
| 38 | |
---|
| 39 | rtems_unsigned32 growth_factor; /* % to grow by when needed */ |
---|
| 40 | |
---|
| 41 | rtems_unsigned32 next; /* next symbol slot to use when adding */ |
---|
| 42 | rtems_unsigned32 size; /* max # of symbols */ |
---|
| 43 | |
---|
| 44 | /* |
---|
| 45 | * Symbol list -- sorted by address (when we do a lookup) |
---|
| 46 | */ |
---|
| 47 | |
---|
| 48 | rtems_symbol_t *addresses; /* symbol array by address */ |
---|
| 49 | |
---|
| 50 | /* |
---|
| 51 | * String list -- sorted by name (when we do a lookup) |
---|
| 52 | * This is a duplicate of the info in table->addresses, but it's |
---|
| 53 | * pretty small, so I don't worry about it. |
---|
| 54 | */ |
---|
| 55 | |
---|
| 56 | rtems_symbol_t *symbols; /* symbol array */ |
---|
| 57 | |
---|
| 58 | /* |
---|
| 59 | * String pool, unsorted, a list of blocks of string data |
---|
| 60 | */ |
---|
| 61 | |
---|
| 62 | rtems_symbol_string_block_t *string_buffer_head; |
---|
| 63 | rtems_symbol_string_block_t *string_buffer_current; |
---|
| 64 | rtems_unsigned32 strings_next; /* next byte to use in this block */ |
---|
| 65 | |
---|
| 66 | } rtems_symbol_table_t; |
---|
| 67 | |
---|
| 68 | #define rtems_symbol_name(sp) ((sp)->name) |
---|
| 69 | #define rtems_symbol_value(sp) ((sp)->value) |
---|
| 70 | |
---|
| 71 | #ifdef __cplusplus |
---|
| 72 | } |
---|
| 73 | #endif |
---|
| 74 | |
---|
| 75 | #endif /* ! _INCLUDE_SYMBOLS_H */ |
---|