Changeset cddcc4a3 in mainline for kernel/generic/src/debug/symtab.c
- Timestamp:
- 2012-08-14T18:16:39Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 669f5cae
- Parents:
- 76d92db1 (diff), 4802dd7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/debug/symtab.c
r76d92db1 rcddcc4a3 210 210 * 211 211 */ 212 int symtab_compl(char *input, size_t size, indev_t * 212 int symtab_compl(char *input, size_t size, indev_t *indev) 213 213 { 214 214 #ifdef CONFIG_SYMTAB … … 227 227 const char *hint; 228 228 char output[MAX_SYMBOL_NAME]; 229 /* Maximum Match Length : Length of longest matching common substring in 230 case more than one match is found */ 229 230 /* 231 * Maximum Match Length: Length of longest matching common substring in 232 * case more than one match is found. 233 */ 231 234 size_t max_match_len = size; 232 235 size_t max_match_len_tmp = size; … … 238 241 239 242 output[0] = 0; 240 241 while ((hint = symtab_search_one(name, &pos))) { 242 ++pos; 243 } 244 243 244 while ((hint = symtab_search_one(name, &pos))) 245 pos++; 246 245 247 pos = 0; 246 248 … … 253 255 } 254 256 255 /* If possible completions are more than MAX_TAB_HINTS, ask user whether to display them or not. */ 257 /* 258 * If the number of possible completions is more than MAX_TAB_HINTS, 259 * ask the user whether to display them or not. 260 */ 256 261 if (found > MAX_TAB_HINTS) { 257 262 printf("\n"); 258 continue_showing_hints = console_prompt_display_all_hints(indev, found); 263 continue_showing_hints = 264 console_prompt_display_all_hints(indev, found); 259 265 } 260 266 … … 265 271 sym_name = symbol_table[pos].symbol_name; 266 272 pos++; 267 268 if (continue_showing_hints) { /* We are still showing hints */ 273 274 if (continue_showing_hints) { 275 /* We are still showing hints */ 269 276 printf("%s\n", sym_name); 270 277 --hints_to_show; 271 278 ++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); 279 280 if ((hints_to_show == 0) && (total_hints_shown != found)) { 281 /* Ask the user to continue */ 282 continue_showing_hints = 283 console_prompt_more_hints(indev, &hints_to_show); 275 284 } 276 285 } 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); 286 287 for (max_match_len_tmp = 0; 288 (output[max_match_len_tmp] == 289 sym_name[input_len + max_match_len_tmp]) && 290 (max_match_len_tmp < max_match_len); ++max_match_len_tmp); 291 280 292 max_match_len = max_match_len_tmp; 281 293 } 282 /* keep only the characters common in all completions */ 294 295 /* Keep only the characters common in all completions */ 283 296 output[max_match_len] = 0; 284 297 }
Note:
See TracChangeset
for help on using the changeset viewer.