Changeset f0d7bd9 in mainline for kernel/generic/src/debug/symtab.c


Ignore:
Timestamp:
2012-07-10T12:32:56Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
aca4a04
Parents:
1e01a35
Message:

Create function for displaying —more— prompt

File:
1 edited

Legend:

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

    r1e01a35 rf0d7bd9  
    4343#include <typedefs.h>
    4444#include <errno.h>
     45#include <console/prompt.h>
    4546
    4647/** Get name of a symbol that seems most likely to correspond to address.
     
    232233        size_t input_len = str_length(input);
    233234        char *sym_name;
    234         char display = 'y';
    235235        size_t hints_to_show = MAX_TAB_HINTS - 1;
    236236        size_t total_hints_shown = 0;
    237         char continue_showing_hints = 'y';
     237        bool continue_showing_hints = true;
    238238       
    239239        output[0] = 0;
     
    256256        if (found > MAX_TAB_HINTS) {
    257257                printf("\nDisplay all %zu possibilities? (y or n)", found);
     258                wchar_t display;
    258259                do {
    259260                        display = indev_pop_character(indev);
    260261                } while (display != 'y' && display != 'n' && display != 'Y' && display != 'N');
     262                continue_showing_hints = (display == 'y') || (display == 'Y');
    261263        }
    262264       
     
    268270                        pos++;
    269271
    270                         if (display == 'y' || display == 'Y') { /* We are still showing hints */
     272                        if (continue_showing_hints) { /* We are still showing hints */
    271273                                printf("%s\n", sym_name);
    272274                                --hints_to_show;
     
    274276
    275277                                if (hints_to_show == 0 && total_hints_shown != found) { /* Time to ask user to continue */
    276                                         printf("--More--");
    277                                         do {
    278                                                 continue_showing_hints = indev_pop_character(indev);
    279                                                 if (continue_showing_hints == 'y' || continue_showing_hints == 'Y'
    280                                                                 || continue_showing_hints == ' ') {
    281                                                         hints_to_show = MAX_TAB_HINTS - 1; /* Display a full page again */
    282                                                         break;
    283                                                 }
    284 
    285                                                 if (continue_showing_hints == 'n' || continue_showing_hints == 'N'
    286                                                                 || continue_showing_hints == 'q' || continue_showing_hints == 'Q') {
    287                                                         display = 'n'; /* Stop displaying hints */
    288                                                         break;
    289                                                 }
    290 
    291                                                 if (continue_showing_hints == '\n') {
    292                                                         hints_to_show = 1; /* Show one more hint */
    293                                                         break;
    294                                                 }
    295                                         } while (1);
    296 
    297                                         printf("\r         \r"); /* Delete the --More-- option */
     278                                        continue_showing_hints = console_prompt_more_hints(indev, &hints_to_show);
    298279                                }
    299280                        }
Note: See TracChangeset for help on using the changeset viewer.