static int
 kdb_bt1(struct task_struct *p, unsigned long mask, bool btaprompt)
 {
-       char buffer[2];
-       if (kdb_getarea(buffer[0], (unsigned long)p) ||
-           kdb_getarea(buffer[0], (unsigned long)(p+1)-1))
+       char ch;
+
+       if (kdb_getarea(ch, (unsigned long)p) ||
+           kdb_getarea(ch, (unsigned long)(p+1)-1))
                return KDB_BADADDR;
        if (!kdb_task_state(p, mask))
                return 0;
        kdb_ps1(p);
        kdb_show_stack(p, NULL);
        if (btaprompt) {
-               kdb_getstr(buffer, sizeof(buffer),
-                          "Enter <q> to end, <cr> to continue:");
-               if (buffer[0] == 'q') {
-                       kdb_printf("\n");
+               kdb_printf("Enter <q> to end, <cr> or <space> to continue:");
+               do {
+                       ch = kdb_getchar();
+               } while (!strchr("\r\n q", ch));
+               kdb_printf("\n");
+
+               /* reset the pager */
+               kdb_nextline = 1;
+
+               if (ch == 'q')
                        return 1;
-               }
        }
        touch_nmi_watchdog();
        return 0;
 
        return -1;
 }
 
-static int kdb_read_get_key(char *buffer, size_t bufsize)
+/**
+ * kdb_getchar() - Read a single character from a kdb console (or consoles).
+ *
+ * Other than polling the various consoles that are currently enabled,
+ * most of the work done in this function is dealing with escape sequences.
+ *
+ * An escape key could be the start of a vt100 control sequence such as \e[D
+ * (left arrow) or it could be a character in its own right.  The standard
+ * method for detecting the difference is to wait for 2 seconds to see if there
+ * are any other characters.  kdb is complicated by the lack of a timer service
+ * (interrupts are off), by multiple input sources. Escape sequence processing
+ * has to be done as states in the polling loop.
+ *
+ * Return: The key pressed or a control code derived from an escape sequence.
+ */
+char kdb_getchar(void)
 {
 #define ESCAPE_UDELAY 1000
 #define ESCAPE_DELAY (2*1000000/ESCAPE_UDELAY) /* 2 seconds worth of udelays */
                }
 
                key = (*f)();
-
                if (key == -1) {
                        if (escape_delay) {
                                udelay(ESCAPE_UDELAY);
                        continue;
                }
 
-               if (bufsize <= 2) {
-                       if (key == '\r')
-                               key = '\n';
-                       *buffer++ = key;
-                       *buffer = '\0';
-                       return -1;
-               }
-
                if (escape_delay == 0 && key == '\e') {
                        escape_delay = ESCAPE_DELAY;
                        ped = escape_data;
  *     function.  It is not reentrant - it relies on the fact
  *     that while kdb is running on only one "master debug" cpu.
  * Remarks:
- *
- * The buffer size must be >= 2.  A buffer size of 2 means that the caller only
- * wants a single key.
- *
- * An escape key could be the start of a vt100 control sequence such as \e[D
- * (left arrow) or it could be a character in its own right.  The standard
- * method for detecting the difference is to wait for 2 seconds to see if there
- * are any other characters.  kdb is complicated by the lack of a timer service
- * (interrupts are off), by multiple input sources and by the need to sometimes
- * return after just one key.  Escape sequence processing has to be done as
- * states in the polling loop.
+ *     The buffer size must be >= 2.
  */
 
 static char *kdb_read(char *buffer, size_t bufsize)
        *cp = '\0';
        kdb_printf("%s", buffer);
 poll_again:
-       key = kdb_read_get_key(buffer, bufsize);
-       if (key == -1)
-               return buffer;
+       key = kdb_getchar();
        if (key != 9)
                tab = 0;
        switch (key) {
 
        /* check for having reached the LINES number of printed lines */
        if (kdb_nextline >= linecount) {
-               char buf1[16] = "";
+               char ch;
 
                /* Watch out for recursion here.  Any routine that calls
                 * kdb_printf will come back through here.  And kdb_read
                if (logging)
                        printk("%s", moreprompt);
 
-               kdb_read(buf1, 2); /* '2' indicates to return
-                                   * immediately after getting one key. */
+               ch = kdb_getchar();
                kdb_nextline = 1;       /* Really set output line 1 */
 
                /* empty and reset the buffer: */
                kdb_buffer[0] = '\0';
                next_avail = kdb_buffer;
                size_avail = sizeof(kdb_buffer);
-               if ((buf1[0] == 'q') || (buf1[0] == 'Q')) {
+               if ((ch == 'q') || (ch == 'Q')) {
                        /* user hit q or Q */
                        KDB_FLAG_SET(CMD_INTERRUPT); /* command interrupted */
                        KDB_STATE_CLEAR(PAGER);
                        /* end of command output; back to normal mode */
                        kdb_grepping_flag = 0;
                        kdb_printf("\n");
-               } else if (buf1[0] == ' ') {
+               } else if (ch == ' ') {
                        kdb_printf("\r");
                        suspend_grep = 1; /* for this recursion */
-               } else if (buf1[0] == '\n') {
+               } else if (ch == '\n' || ch == '\r') {
                        kdb_nextline = linecount - 1;
                        kdb_printf("\r");
                        suspend_grep = 1; /* for this recursion */
-               } else if (buf1[0] == '/' && !kdb_grepping_flag) {
+               } else if (ch == '/' && !kdb_grepping_flag) {
                        kdb_printf("\r");
                        kdb_getstr(kdb_grep_string, KDB_GREP_STRLEN,
                                   kdbgetenv("SEARCHPROMPT") ?: "search> ");
                        *strchrnul(kdb_grep_string, '\n') = '\0';
                        kdb_grepping_flag += KDB_GREPPING_FLAG_SEARCH;
                        suspend_grep = 1; /* for this recursion */
-               } else if (buf1[0] && buf1[0] != '\n') {
-                       /* user hit something other than enter */
+               } else if (ch) {
+                       /* user hit something unexpected */
                        suspend_grep = 1; /* for this recursion */
-                       if (buf1[0] != '/')
+                       if (ch != '/')
                                kdb_printf(
                                    "\nOnly 'q', 'Q' or '/' are processed at "
                                    "more prompt, input ignored\n");