Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: Don Howard <dhoward@redhat.com>
Cc: Kevin Buettner <kevinb@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: [Patch] Another small memattr fix.
Date: Sat, 15 Jun 2002 18:28:00 -0000	[thread overview]
Message-ID: <3D0BE9C3.90209@cygnus.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0206141345140.3839-100000@theotherone>


>> I can think of three alternatives:
>> 
>> 	[base, bound)
>> 	[base, bound]
>> 	[base, base+size-1)

Try [base, base+(size-1)]

(and the paren are important :-)

>> 
>> The first one is what the doco says and has been there for a while so I 
>> don't think that changing it is a good idea.
>> 
>> Internally, I suspect base+size-1 is the best representation.  However, 
>> for the user interface, is there anything that really says that:
>> 
>> 	mem 0xfffffff0 0
>>
>> is either illegal or poorly defined?  
> 
> 
> 
> The fact that the first bound is inclusive and the second is exclusive
> implies that to me. Also, the current implemntation enforces it.

Don, sorry, I'm not sure what you mean here.


> How's this: let the parser find the size of the region for us:
> 
> labs (parse_and_evaluate_long (tok1 " - " tok2));

I think it is better to evaluate low/high and then compute the range 
directly.

I wouldn't trust the above expression to always do what you want.

> That seems to avoid the max int problem.  Then we can use base and size
> as the internal representation.

No matter what is done I think there will be an edge condition.  For 
instance:

[base, base+(size-1)]

doesn't work very well when base==0 :-)

Andrew



  reply	other threads:[~2002-06-16  1:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-12 16:32 Don Howard
2002-06-12 19:40 ` Andrew Cagney
2002-06-13 10:33   ` Don Howard
2002-06-14 11:28 ` Kevin Buettner
2002-06-14 12:44   ` Don Howard
2002-06-14 13:00     ` Kevin Buettner
2002-06-14 13:30       ` Andrew Cagney
2002-06-14 14:19         ` Don Howard
2002-06-15 18:28           ` Andrew Cagney [this message]
2002-06-17 10:47             ` Don Howard

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=3D0BE9C3.90209@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=dhoward@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kevinb@redhat.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