Changeset 5d494b3 in mainline for kernel/generic/src/debug/symtab.c
- Timestamp:
- 2008-04-03T20:05:06Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 776f2e6
- Parents:
- dfa7bac
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/debug/symtab.c
rdfa7bac r5d494b3 37 37 38 38 #include <symtab.h> 39 #include < arch/byteorder.h>39 #include <byteorder.h> 40 40 #include <func.h> 41 41 #include <print.h> … … 54 54 count_t i; 55 55 56 for (i =1;symbol_table[i].address_le;++i) {56 for (i = 1; symbol_table[i].address_le; ++i) { 57 57 if (addr < uint64_t_le2host(symbol_table[i].address_le)) 58 58 break; 59 59 } 60 if (addr >= uint64_t_le2host(symbol_table[i -1].address_le))61 return symbol_table[i -1].symbol_name;60 if (addr >= uint64_t_le2host(symbol_table[i - 1].address_le)) 61 return symbol_table[i - 1].symbol_name; 62 62 return NULL; 63 63 } … … 73 73 unsigned int namelen = strlen(name); 74 74 char *curname; 75 int i, j;75 int i, j; 76 76 int colonoffset = -1; 77 77 78 for (i =0;name[i];i++)78 for (i = 0; name[i]; i++) 79 79 if (name[i] == ':') { 80 80 colonoffset = i; … … 82 82 } 83 83 84 for (i =*startpos;symbol_table[i].address_le;++i) {84 for (i = *startpos; symbol_table[i].address_le; ++i) { 85 85 /* Find a ':' in name */ 86 86 curname = symbol_table[i].symbol_name; 87 for (j =0; curname[j] && curname[j] != ':'; j++)87 for (j = 0; curname[j] && curname[j] != ':'; j++) 88 88 ; 89 89 if (!curname[j]) … … 95 95 if (strncmp(curname, name, namelen) == 0) { 96 96 *startpos = i; 97 return curname +namelen;97 return curname + namelen; 98 98 } 99 99 } … … 116 116 117 117 i = 0; 118 while ((hint =symtab_search_one(name, &i))) {118 while ((hint = symtab_search_one(name, &i))) { 119 119 if (!strlen(hint)) { 120 120 addr = uint64_t_le2host(symbol_table[i].address_le); … … 152 152 int symtab_compl(char *input) 153 153 { 154 char output[MAX_SYMBOL_NAME +1];154 char output[MAX_SYMBOL_NAME + 1]; 155 155 int startpos = 0; 156 156 char *foundtxt; … … 173 173 startpos++; 174 174 if (!found) 175 strncpy(output, foundtxt, strlen(foundtxt) +1);175 strncpy(output, foundtxt, strlen(foundtxt) + 1); 176 176 else { 177 for (i=0; output[i] && foundtxt[i] && output[i]==foundtxt[i]; i++) 177 for (i = 0; output[i] && foundtxt[i] && 178 output[i] == foundtxt[i]; i++) 178 179 ; 179 180 output[i] = '\0';
Note:
See TracChangeset
for help on using the changeset viewer.