Changes in kernel/generic/src/debug/symtab.c [aca4a04:7e752b2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/debug/symtab.c
raca4a04 r7e752b2 43 43 #include <typedefs.h> 44 44 #include <errno.h> 45 #include <console/prompt.h>46 45 47 46 /** Get name of a symbol that seems most likely to correspond to address. … … 210 209 * 211 210 */ 212 int symtab_compl(char *input, size_t size , indev_t * indev)211 int symtab_compl(char *input, size_t size) 213 212 { 214 213 #ifdef CONFIG_SYMTAB … … 227 226 const char *hint; 228 227 char output[MAX_SYMBOL_NAME]; 229 /* Maximum Match Length : Length of longest matching common substring in230 case more than one match is found */231 size_t max_match_len = size;232 size_t max_match_len_tmp = size;233 size_t input_len = str_length(input);234 char *sym_name;235 size_t hints_to_show = MAX_TAB_HINTS - 1;236 size_t total_hints_shown = 0;237 bool continue_showing_hints = true;238 228 239 229 output[0] = 0; 240 241 while ((hint = symtab_search_one(name, &pos))) {242 ++pos;243 }244 245 pos = 0;246 230 247 231 while ((hint = symtab_search_one(name, &pos))) { … … 251 235 pos++; 252 236 found++; 253 }254 255 /* If possible completions are more than MAX_TAB_HINTS, ask user whether to display them or not. */256 if (found > MAX_TAB_HINTS) {257 printf("\n");258 continue_showing_hints = console_prompt_display_all_hints(indev, found);259 237 } 260 238 … … 263 241 pos = 0; 264 242 while (symtab_search_one(name, &pos)) { 265 sym_name = symbol_table[pos].symbol_name;243 printf("%s\n", symbol_table[pos].symbol_name); 266 244 pos++; 267 268 if (continue_showing_hints) { /* We are still showing hints */269 printf("%s\n", sym_name);270 --hints_to_show;271 ++total_hints_shown;272 273 if (hints_to_show == 0 && total_hints_shown != found) { /* Time to ask user to continue */274 continue_showing_hints = console_prompt_more_hints(indev, &hints_to_show);275 }276 }277 278 for(max_match_len_tmp = 0; output[max_match_len_tmp] == sym_name[input_len + max_match_len_tmp]279 && max_match_len_tmp < max_match_len; ++max_match_len_tmp);280 max_match_len = max_match_len_tmp;281 245 } 282 /* keep only the characters common in all completions */283 output[max_match_len] = 0;284 246 } 285 247
Note:
See TracChangeset
for help on using the changeset viewer.