Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/debug/symtab.c

    raca4a04 r9d58539  
    4343#include <typedefs.h>
    4444#include <errno.h>
    45 #include <console/prompt.h>
    4645
    4746/** Get name of a symbol that seems most likely to correspond to address.
     
    210209 *
    211210 */
    212 int symtab_compl(char *input, size_t size, indev_t * indev)
     211int symtab_compl(char *input, size_t size)
    213212{
    214213#ifdef CONFIG_SYMTAB
     
    227226        const char *hint;
    228227        char output[MAX_SYMBOL_NAME];
    229         /* Maximum Match Length : Length of longest matching common substring in
    230            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;
    238228       
    239229        output[0] = 0;
    240 
    241         while ((hint = symtab_search_one(name, &pos))) {
    242                 ++pos;
    243         }
    244 
    245         pos = 0;
    246230       
    247231        while ((hint = symtab_search_one(name, &pos))) {
     
    251235                pos++;
    252236                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);
    259237        }
    260238       
     
    263241                pos = 0;
    264242                while (symtab_search_one(name, &pos)) {
    265                         sym_name = symbol_table[pos].symbol_name;
     243                        printf("%s\n", symbol_table[pos].symbol_name);
    266244                        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;
    281245                }
    282                 /* keep only the characters common in all completions */
    283                 output[max_match_len] = 0;
    284246        }
    285247       
Note: See TracChangeset for help on using the changeset viewer.