Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/6] Tweak in memory_error
Date: Thu, 06 Feb 2014 12:41:00 -0000	[thread overview]
Message-ID: <52F3830D.3070201@redhat.com> (raw)
In-Reply-To: <1391139325-2758-2-git-send-email-yao@codesourcery.com>

On 01/31/2014 03:35 AM, Yao Qi wrote:
> This patch adds a local variable exception of type 'enum errors' and
> pass it to throw_error.

Ah, took me a second to realize _why_.  OK, but could you
add this to the commit log please ? :

  'err' is of type 'enum target_xfer_error', and we're abusing it
  to store an 'enum errors'.

Thanks!

-- 
Pedro Alves

> 
> gdb:
> 
> 2014-01-30  Yao Qi  <yao@codesourcery.com>
> 
> 	* corefile.c (memory_error): Get 'exception' from ERR and pass
> 	'exception' to throw_error.
> ---
>  gdb/corefile.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/gdb/corefile.c b/gdb/corefile.c
> index 1ed8395..93f5e04 100644
> --- a/gdb/corefile.c
> +++ b/gdb/corefile.c
> @@ -221,6 +221,7 @@ void
>  memory_error (enum target_xfer_error err, CORE_ADDR memaddr)
>  {
>    char *str;
> +  enum errors exception = GDB_NO_ERROR;
>  
>    /* Build error string.  */
>    str = memory_error_message (err, target_gdbarch (), memaddr);
> @@ -230,15 +231,15 @@ memory_error (enum target_xfer_error err, CORE_ADDR memaddr)
>    switch (err)
>      {
>      case TARGET_XFER_E_IO:
> -      err = MEMORY_ERROR;
> +      exception = MEMORY_ERROR;
>        break;
>      case TARGET_XFER_E_UNAVAILABLE:
> -      err = NOT_AVAILABLE_ERROR;
> +      exception = NOT_AVAILABLE_ERROR;
>        break;
>      }
>  
>    /* Throw it.  */
> -  throw_error (err, ("%s"), str);
> +  throw_error (exception, ("%s"), str);
>  }
>  
>  /* Same as target_read_memory, but report an error if can't read.  */
> 


  reply	other threads:[~2014-02-06 12:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-31  3:37 [PATCH 0/6] Return target_xfer_status in to_xfer_partial Yao Qi
2014-01-31  3:37 ` [PATCH 1/6] Tweak in memory_error Yao Qi
2014-02-06 12:41   ` Pedro Alves [this message]
2014-02-07  4:21     ` Yao Qi
2014-01-31  3:37 ` [PATCH 2/6] core_xfer_shared_libraries and core_xfer_shared_libraries_aix returns ULONGEST Yao Qi
2014-02-06 14:43   ` Pedro Alves
2014-02-07  4:21     ` Yao Qi
2014-01-31  3:38 ` [PATCH 6/6] Update comments to to_xfer_partial implementations Yao Qi
2014-01-31  3:50   ` Joel Brobecker
2014-01-31  3:38 ` [PATCH 3/6] Replace -1 with TARGET_XFER_E_IO Yao Qi
2014-02-06 14:43   ` Pedro Alves
2014-01-31  3:38 ` [PATCH 4/6] Return early in target_xfer_partial when LEN is zero Yao Qi
2014-02-06 14:44   ` Pedro Alves
2014-01-31  3:39 ` [PATCH 5/6] Return target_xfer_status in to_xfer_partial Yao Qi
2014-02-06 14:44   ` Pedro Alves
2014-02-07  2:11     ` Yao Qi
2014-02-11  6:35     ` 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=52F3830D.3070201@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