Input range for multiple symbols in debugger

James Juran jamesjuran at
Fri May 18 23:57:47 CDT 2001

The debugger now allows the user to choose which symbol to break on, when
multiple symbols with the same name are found.  It is currently
displaying a list of choices from 1..n, but accepting responses
from 0..n-1.  This patch makes it accept responses from
1..n, and subtracts one from the response before returning to match
the current behavior.  It also adds a message indicating when an
out-of-range number is entered, rather than silently ignoring
the input.

	James Juran <jamesjuran at>
	Accept responses from 1..n when choosing from multiple
	symbols to match the input labels.

Index: debugger/hash.c
RCS file: /home/wine/wine/debugger/hash.c,v
retrieving revision 1.21
diff -u -r1.21 hash.c
--- debugger/hash.c	2001/05/03 18:32:47	1.21
+++ debugger/hash.c	2001/05/19 04:50:59
@@ -402,7 +402,12 @@
 	 ptr = readline("=> ");
 	 if (!*ptr) return FALSE;
 	 i = atoi(ptr);
-      } while (i < 0 || i >= num);
+	 if (i < 1 || i > num)
+	     DEBUG_Printf(DBG_CHN_MESG, "Invalid choice %d\n", i);
+      } while (i < 1 || i > num);
+      /* The array is 0-based, but the choices are 1..n, so we have to subtract one before returning. */
+      i--;
    *rtn = value[i];
    return TRUE;

More information about the wine-patches mailing list