Lines Matching +full:key +full:- +full:home
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,
59 * otherwise it returns a mapped key value to pass to the upper layers.
63 char *lastkey = buf + sz - 1; in kdb_handle_escape()
86 case '1': /* \e[<1,3,4>], may be home, del, end */ in kdb_handle_escape()
96 case '1': /* \e[1~, home */ in kdb_handle_escape()
107 return -1; in kdb_handle_escape()
111 * kdb_getchar() - Read a single character from a kdb console (or consoles).
116 * An escape key could be the start of a vt100 control sequence such as \e[D
123 * Return: The key pressed or a control code derived from an escape sequence.
133 int key; in kdb_getchar() local
143 key = (*f)(); in kdb_getchar()
144 if (key == -1) { in kdb_getchar()
147 if (--escape_delay == 0) in kdb_getchar()
159 if (last_char_was_cr && key == '\n') { in kdb_getchar()
163 last_char_was_cr = (key == '\r'); in kdb_getchar()
176 *pbuf++ = key; in kdb_getchar()
177 key = kdb_handle_escape(buf, pbuf - buf); in kdb_getchar()
178 if (key < 0) /* no escape sequence; return best character */ in kdb_getchar()
179 return buf[pbuf - buf == 2 ? 1 : 0]; in kdb_getchar()
180 if (key > 0) in kdb_getchar()
181 return key; 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()
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()
250 int key, ret; in kdb_read() local
258 if (*(buffer+len-1) == '\n') in kdb_read()
259 cp--; in kdb_read()
266 key = kdb_getchar(); in kdb_read()
267 if (key != 9) in kdb_read()
269 switch (key) { 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()
297 case 1: /* Home */ in kdb_read()
312 --cp; in kdb_read()
318 (int)(strlen(kdb_prompt_str) + (lastchar - buffer)), in kdb_read()
320 *lastchar = (char)key; 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()
390 if (key >= 32 && lastchar < bufend) { in kdb_read()
392 memmove(cp+1, cp, lastchar - cp + 1); in kdb_read()
394 *cp = key; in kdb_read()
400 *cp++ = key; in kdb_read()
409 kdb_printf("%c", key); 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()
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
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()
680 * (MOREPROMPT -> moreprompt) in vkdb_printf()
708 size_avail = sizeof(kdb_buffer) - len; 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()
839 kdb_nextline = linecount - 1; in vkdb_printf()
878 size_avail = sizeof(kdb_buffer) - len; in vkdb_printf()