From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13233 invoked by alias); 25 Feb 2014 16:24:16 -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 13215 invoked by uid 89); 25 Feb 2014 16:24:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 25 Feb 2014 16:24:13 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 15175116243 for ; Tue, 25 Feb 2014 11:24:12 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id BGVVbAhQqA2A for ; Tue, 25 Feb 2014 11:24:12 -0500 (EST) Received: from kwai.gnat.com (unknown [IPv6:2620:20:4000:0:a6ba:dbff:fe26:1f63]) by rock.gnat.com (Postfix) with ESMTP id 06E0211623A for ; Tue, 25 Feb 2014 11:24:12 -0500 (EST) Received: by kwai.gnat.com (Postfix, from userid 4233) id 035C491A7C; Tue, 25 Feb 2014 11:24:12 -0500 (EST) From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [commit] Adjust ia64_linux_xfer_partial following to_xfer_partial API change. Date: Tue, 25 Feb 2014 16:24:00 -0000 Message-Id: <1393345450-20878-1-git-send-email-brobecker@adacore.com> X-SW-Source: 2014-02/txt/msg00753.txt.bz2 Hello, ia64-linux-nat.c no longer compiles because ia64_linux_xfer_partial no longer matches the to_xfer_partial prototype. This patch fixes the problem by adjusting it accordingly. gdb/ChangeLog: * ia64-linux-nat.c (ia64_linux_xfer_partial): Add function documentation. Adjust prototype to match the target_ops to_xfer_partial method. Adjust implementation accordingly. The official testsuite badly crashed our ia64-linux machine :-(. But I was able to run the AdaCore testsuite to test this change. Pushed. --- gdb/ChangeLog | 6 ++++++ gdb/ia64-linux-nat.c | 28 +++++++++++++++++++++++----- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d3ae4f2..b2385c1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2014-02-25 Joel Brobecker + + * ia64-linux-nat.c (ia64_linux_xfer_partial): Add function + documentation. Adjust prototype to match the target_ops + to_xfer_partial method. Adjust implementation accordingly. + 2014-02-25 Hui Zhu * target.h (target_ops): Fix TARGET_DEFAULT_RETURN of diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c index ccd55b2..c057b55 100644 --- a/gdb/ia64-linux-nat.c +++ b/gdb/ia64-linux-nat.c @@ -838,18 +838,36 @@ ia64_linux_store_registers (struct target_ops *ops, static target_xfer_partial_ftype *super_xfer_partial; -static LONGEST +/* Implement the to_xfer_partial target_ops method. */ + +static enum target_xfer_status ia64_linux_xfer_partial (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, - ULONGEST offset, ULONGEST len) + ULONGEST offset, ULONGEST len, + ULONGEST *xfered_len) { - if (object == TARGET_OBJECT_UNWIND_TABLE && writebuf == NULL && offset == 0) - return syscall (__NR_getunwind, readbuf, len); + if (object == TARGET_OBJECT_UNWIND_TABLE && readbuf != NULL) + { + gdb_byte *tmp_buf = alloca (offset + len); + ULONGEST xfered; + + xfered = syscall (__NR_getunwind, readbuf, offset + len); + if (xfered <= 0) + return TARGET_XFER_E_IO; + else if (xfered <= offset) + return TARGET_XFER_EOF; + else + { + memcpy (readbuf, tmp_buf + offset, xfered - offset); + *xfered_len = xfered - offset; + return TARGET_XFER_OK; + } + } return super_xfer_partial (ops, object, annex, readbuf, writebuf, - offset, len); + offset, len, xfered_len); } /* For break.b instruction ia64 CPU forgets the immediate value and generates -- 1.7.9.5