This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [COMMIT (mainline+7.6) PATCH] Fix PR gdb/15289 - "set remote hardware-watchpoint-limit" broken (zinteger commands)


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 (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]