Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: Don Howard <dhoward@redhat.com>
Cc: <gdb-patches@sources.redhat.com>
Subject: Re: [Patch] Another small memattr fix.
Date: Fri, 14 Jun 2002 13:00:00 -0000	[thread overview]
Message-ID: <1020614200008.ZM24922@localhost.localdomain> (raw)
In-Reply-To: Don Howard <dhoward@redhat.com> "Re: [Patch] Another small memattr fix." (Jun 14, 12:44pm)

On Jun 14, 12:44pm, Don Howard wrote:

> The strings are arbitrary expressions and are converted to address via
> parse_and_eval_address(), which does not flag overflow:
> 
> mem_command (char *args, int from_tty)
> {
>   CORE_ADDR lo, hi;
>   char *tok;
>   struct mem_attrib attrib;
> 
>   if (!args)
>     error_no_arg ("No mem");
> 
>   tok = strtok (args, " \t");
>   if (!tok)
>     error ("no lo address");
>   lo = parse_and_eval_address (tok);
> 
>   tok = strtok (NULL, " \t");
>   if (!tok)
>     error ("no hi address");
>   hi = parse_and_eval_address (tok);
> 
> mabe parse_and_eval_address could detect overflow and throw an error().

Maybe I'm missing something, but it seems to me that you're still left
with the problem of how to represent the maximum address + 1.  (Throwing
an error doesn't really help, does it?)

> Another possiblity is that the interface could be changed, making the
> upper bound inclusive also. 

This sounds better.

So, on a 16 bit machine, you could say

    mem 0xf000 0xffff ro

to indicate that the top 4096 bytes are read-only.

Kevin


  reply	other threads:[~2002-06-14 20:00 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 [this message]
2002-06-14 13:30       ` Andrew Cagney
2002-06-14 14:19         ` Don Howard
2002-06-15 18:28           ` Andrew Cagney
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=1020614200008.ZM24922@localhost.localdomain \
    --to=kevinb@redhat.com \
    --cc=dhoward@redhat.com \
    --cc=gdb-patches@sources.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