Lines Matching +full:left +full:- +full:input +full:- +full:single +full:- +full:end
8 * Copyright (c) 1999-2006 Silicon Graphics, Inc. All Rights Reserved.
32 int kdb_printf_cpu = -1;
41 if (slen > 3 && buffer[slen - 3] == '#') { in kgdb_transition_check()
52 * kdb_handle_escape() - validity check on an accumulated escape sequence.
58 * Return: -1 if the escape sequence is unwanted, 0 if it is incomplete,
63 char *lastkey = buf + sz - 1; in kdb_handle_escape()
84 case 'D': /* \e[D, left arrow */ in kdb_handle_escape()
86 case '1': /* \e[<1,3,4>], may be home, del, end */ in kdb_handle_escape()
100 case '4': /* \e[4~, end */ in kdb_handle_escape()
107 return -1; in kdb_handle_escape()
111 * kdb_getchar() - Read a single character from a kdb console (or consoles).
117 * (left arrow) or it could be a character in its own right. The standard
120 * (interrupts are off), by multiple input sources. Escape sequence processing
144 if (key == -1) { in kdb_getchar()
147 if (--escape_delay == 0) in kdb_getchar()
167 * input source) we set ourselves up to handle an escape in kdb_getchar()
177 key = kdb_handle_escape(buf, pbuf - buf); in kdb_getchar()
179 return buf[pbuf - buf == 2 ? 1 : 0]; in kdb_getchar()
188 * kdb_position_cursor() - Place cursor in the correct horizontal position
189 * @prompt: Nil-terminated string containing the prompt string
190 * @buffer: Nil-terminated string containing the entire command line
194 * The cursor is positioned by sending a carriage-return and then printing
199 * Firstly, even though kdb_printf() will correctly format zero-width fields
211 kdb_printf("%.*s", (int)(cp - buffer), buffer); in kdb_position_cursor()
218 * a newline, or by reaching the end of the supplied buffer,
221 * buffer - Address of character buffer to receive input characters.
222 * bufsize - size, in bytes, of the character buffer
229 * function. It is not reentrant - it relies on the fact
238 char *bufend = buffer+bufsize-2; /* Reserve space for newline in kdb_read()
258 if (*(buffer+len-1) == '\n') in kdb_read()
259 cp--; in kdb_read()
272 memmove(cp-1, cp, lastchar - cp + 1); in kdb_read()
273 lastchar--; in kdb_read()
274 cp--; in kdb_read()
291 memmove(cp, cp+1, lastchar - cp); in kdb_read()
292 lastchar--; in kdb_read()
303 case 5: /* End */ in kdb_read()
309 case 2: /* Left */ in kdb_read()
312 --cp; in kdb_read()
318 (int)(strlen(kdb_prompt_str) + (lastchar - buffer)), in kdb_read()
356 if (ret != -E2BIG) in kdb_read()
371 len_tmp = strlen(tmpbuffer) - len; in kdb_read()
373 len_tmp = bufend - lastchar; in kdb_read()
377 memmove(cp+len_tmp, cp, (lastchar-cp) + 1); in kdb_read()
392 memmove(cp+1, cp, lastchar - cp + 1); in kdb_read()
413 if (lastchar - buffer >= 5 && in kdb_read()
414 strcmp(lastchar - 5, "$?#3f") == 0) { in kdb_read()
415 kdb_gdb_state_pass(lastchar - 5); in kdb_read()
420 if (lastchar - buffer >= 11 && in kdb_read()
421 strcmp(lastchar - 11, "$qSupported") == 0) { in kdb_read()
422 kdb_gdb_state_pass(lastchar - 11); in kdb_read()
437 * input device.
457 kdb_nextline = 1; /* Prompt and input resets line number */ in kdb_getstr()
464 * Get rid of any buffered console input.
473 * Call this function whenever you want to flush input. If there is any
474 * outstanding input, it ignores all characters until there has been no
484 flush_delay--; in kdb_input_flush()
489 if (res != -1) { in kdb_input_flush()
505 * printf-like format and optional args.
511 * use 'kdbcons->write()' to avoid polluting 'log_buf' with
536 /* not counting the newline at the end of "searched" */ in kdb_search_string()
537 len1 = strlen(searched)-1; in kdb_search_string()
547 if (!strncmp(searched+len1-len2, searchfor, len2)) in kdb_search_string()
574 while (len--) { in kdb_msg_write()
575 dbg_io_ops->write_char(*cp); in kdb_msg_write()
581 * traversal. The use of the ->write() callback relies on all other in kdb_msg_write()
594 if (c == dbg_io_ops->cons) in kdb_msg_write()
596 if (!c->write) in kdb_msg_write()
602 * due to re-entering the console driver. We operate directly on in kdb_msg_write()
608 c->write(c, msg, msg_len); in kdb_msg_write()
609 --oops_in_progress; in kdb_msg_write()
635 old_cpu = cmpxchg(&kdb_printf_cpu, -1, this_cpu); in vkdb_printf()
636 if (old_cpu == -1 || old_cpu == this_cpu) in vkdb_printf()
666 * (vsnprintf does null-terminate the string that it generates) in vkdb_printf()
674 * Special cases that don't end with newlines in vkdb_printf()
680 * (MOREPROMPT -> moreprompt) in vkdb_printf()
708 size_avail = sizeof(kdb_buffer) - len; in vkdb_printf()
719 *cp = '\0'; /* end the string for our search */ in vkdb_printf()
722 * We now have a newline at the end of the string in vkdb_printf()
732 * Shift the buffer left. in vkdb_printf()
738 size_avail = sizeof(kdb_buffer) - len; in vkdb_printf()
745 * its original value to ensure multi-line strings in vkdb_printf()
764 gdbstub_msg_write(cp, retlen - (cp - kdb_buffer)); in vkdb_printf()
766 kdb_msg_write(cp, retlen - (cp - kdb_buffer)); in vkdb_printf()
785 while (len--) { in vkdb_printf()
832 /* end of command output; back to normal mode */ in vkdb_printf()
839 kdb_nextline = linecount - 1; in vkdb_printf()
855 "more prompt, input ignored\n"); in vkdb_printf()
858 "grep filtering, input ignored\n"); in vkdb_printf()
868 * For grep searches, shift the printed string left. in vkdb_printf()
878 size_avail = sizeof(kdb_buffer) - len; in vkdb_printf()
882 suspend_grep = 0; /* end of what may have been a recursive call */ in vkdb_printf()