This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [COMMIT (mainline+7.6) PATCH] Fix PR gdb/15289 - "set remote hardware-watchpoint-limit" broken (zinteger commands)
- From: Yao Qi <yao at codesourcery dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Fri, 22 Mar 2013 09:38:33 +0800
- Subject: Re: [COMMIT (mainline+7.6) PATCH] Fix PR gdb/15289 - "set remote hardware-watchpoint-limit" broken (zinteger commands)
- References: <20130320192304 dot 7464 dot 3655 dot stgit at brno dot lan>
On 03/21/2013 03:23 AM, Pedro Alves wrote:
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -272,13 +272,17 @@ do_set_command (char *arg, int from_tty, struct cmd_list_element *c)
break;
case var_uinteger:
case var_zuinteger:
- if (arg == NULL)
- error_no_arg (_("integer to set it to."));
{
- unsigned int val = parse_and_eval_long (arg);
+ LONGEST val;
+
+ if (arg == NULL)
+ error_no_arg (_("integer to set it to."));
+ val = parse_and_eval_long (arg);
if (c->var_type == var_uinteger && val == 0)
val = UINT_MAX;
+ else if (val > UINT_MAX)
else if (val < 0 || val > UINT_MAX)
+ error (_("integer %s out of range"), plongest (val));
I noticed this problem last year, and posted a patch
http://sourceware.org/ml/gdb-patches/2012-09/msg00090.html
I can't recall why I didn't ping it. Anyway, good to see the problem
get fixed and thanks.
--
Yao (éå)