From: Pedro Alves <palves@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] use zuinteger_unlimited for some remote commands
Date: Mon, 04 Mar 2013 13:19:00 -0000 [thread overview]
Message-ID: <51349F6E.8020101@redhat.com> (raw)
In-Reply-To: <1360934868-5807-2-git-send-email-yao@codesourcery.com>
On 02/15/2013 01:27 PM, Yao Qi wrote:
> -int remote_hw_watchpoint_limit = -1;
> -int remote_hw_watchpoint_length_limit = -1;
> -int remote_hw_breakpoint_limit = -1;
> +static unsigned int remote_hw_watchpoint_limit = UINT_MAX;
> +static unsigned int remote_hw_watchpoint_length_limit = UINT_MAX;
> +static unsigned int remote_hw_breakpoint_limit = UINT_MAX;
...
> @@ -8259,7 +8255,7 @@ remote_check_watch_resources (int type, int cnt, int ot)
> {
> if (remote_hw_watchpoint_limit == 0)
> return 0;
> - else if (remote_hw_watchpoint_limit < 0)
> + else if (remote_hw_watchpoint_limit == UINT_MAX)
This made me notice something with var_zuinteger_unlimited.
What's the point of making it work with unsigned variables,
and UINT_MAX, if the contents of the variable are actually
treated as int everywhere in cli-setshow.c? (and val is
still cut at INT_MAX). Vis, e.g.,
case var_zuinteger_unlimited:
{
LONGEST val;
if (arg == NULL)
error_no_arg (_("integer to set it to."));
val = parse_and_eval_long (arg);
if (val >= INT_MAX)
error (_("integer %s out of range"), plongest (val));
else if (val < -1)
error (_("only -1 is allowed to set as unlimited"));
if (*(int *) c->var != val)
{
*(int *) c->var = val;
option_changed = 1;
}
If reads like cli-setshow.c's handling of
var_zuinteger_unlimited was never fully finished?
--
Pedro Alves
next prev parent reply other threads:[~2013-03-04 13:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-15 13:29 [PATCH 0/2] Use zuinteger_unlimited Yao Qi
2013-02-15 13:29 ` [PATCH 1/2] use zuinteger_unlimited for some remote commands Yao Qi
2013-03-04 13:19 ` Pedro Alves [this message]
2013-03-04 14:38 ` Yao Qi
2013-03-04 16:21 ` Pedro Alves
2013-03-05 7:45 ` Yao Qi
2013-03-05 12:59 ` Pedro Alves
2013-03-05 17:33 ` Doug Evans
2013-03-05 18:07 ` Pedro Alves
2013-03-06 0:30 ` Doug Evans
2013-02-15 13:29 ` [PATCH 2/2] use zuinteger_unlimited for heuristic-fence-post Yao Qi
2013-02-25 3:15 ` ping : [PATCH 0/2] Use zuinteger_unlimited Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51349F6E.8020101@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=yao@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox