From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16353 invoked by alias); 7 Feb 2014 04:21:49 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 15262 invoked by uid 89); 7 Feb 2014 04:21:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=3.6 required=5.0 tests=AWL,BAYES_00,GARBLED_BODY,URIBL_BLACK autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Feb 2014 04:21:47 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WBcwh-000488-5v from Yao_Qi@mentor.com ; Thu, 06 Feb 2014 20:21:43 -0800 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 6 Feb 2014 20:21:42 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Thu, 6 Feb 2014 20:21:42 -0800 Message-ID: <52F45ED4.5070407@codesourcery.com> Date: Fri, 07 Feb 2014 04:21:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Pedro Alves CC: Subject: Re: [PATCH 1/6] Tweak in memory_error References: <1391139325-2758-1-git-send-email-yao@codesourcery.com> <1391139325-2758-2-git-send-email-yao@codesourcery.com> <52F3830D.3070201@redhat.com> In-Reply-To: <52F3830D.3070201@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00182.txt.bz2 On 02/06/2014 08:41 PM, Pedro Alves wrote: > 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'. Sure. Patch below is what I pushed. -- Yao (齐尧) Subject: [PATCH 1/6] Tweak in memory_error This patch adds a local variable exception of type 'enum errors' and pass it to throw_error, because 'err' is of type 'enum target_xfer_error', and we're abusing it to store an 'enum errors'. gdb: 2014-02-07 Yao Qi * corefile.c (memory_error): Get 'exception' from ERR and pass 'exception' to throw_error. --- gdb/ChangeLog | 5 +++++ gdb/corefile.c | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 94c3971..de3c3a6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2014-02-07 Yao Qi + + * corefile.c (memory_error): Get 'exception' from ERR and pass + 'exception' to throw_error. + 2014-02-06 Doug Evans * configure.ac (libpython checking): Remove all but python.o from 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. */ -- 1.7.7.6