From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46720 invoked by alias); 14 Nov 2016 17:43:12 -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 46320 invoked by uid 89); 14 Nov 2016 17:43:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=1.9.1, longest, HX-Received:10.99.170.79, UD:regcache.h X-HELO: mail-pg0-f66.google.com Received: from mail-pg0-f66.google.com (HELO mail-pg0-f66.google.com) (74.125.83.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 Nov 2016 17:42:59 +0000 Received: by mail-pg0-f66.google.com with SMTP id e9so9127621pgc.1 for ; Mon, 14 Nov 2016 09:42:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=UwnVjgAgRodfAy2pWdx7toZXXACenyAQH34NjPBBmss=; b=JXuJEWiPlujaodBQj0GAvRqQolbfIHv4Zbfu9TEiRcNw6L4eY8HBBzUzNzZ/mCB7AG +JctuCyGWip/g3ay05JfKysTjYmxQy6E8eFWjQge9MfFjcVZRL2xYcjT3jKigInlAGhc 0B+TSEnwsZ9vgTVuc1IyfDYJNwGHBKQlereLi+eFOEJM9X7MbHCZ6ncWbnojKzyzGmQr uVEI3xVHhvmlyVThHCUSy6+96LAeR8nB/QZukU9Z7pbtAJ85ydL8CKv5apTCpPZwAQ9+ jbgBs7f+AAdLtE2jcMCm1CqkBsF9qanNTUfOQy3jVhg8DPuDG8mdibq1/Z4Qq1amsNKw 0Xcg== X-Gm-Message-State: ABUngvexmsTkDay+b+qTcaiJn+Kw6+EJzhppEI9ZbeX+i9nwgcTyL0jmx0E3WzTSfsRvFw== X-Received: by 10.99.170.79 with SMTP id x15mr2387154pgo.14.1479145378126; Mon, 14 Nov 2016 09:42:58 -0800 (PST) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id y29sm36696024pfd.63.2016.11.14.09.42.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Nov 2016 09:42:57 -0800 (PST) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 01/13] New regcache_raw_get_signed Date: Mon, 14 Nov 2016 17:43:00 -0000 Message-Id: <1479145370-11432-2-git-send-email-yao.qi@linaro.org> In-Reply-To: <1479145370-11432-1-git-send-email-yao.qi@linaro.org> References: <1479145370-11432-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00351.txt.bz2 This patch adds a new regcache api regcache_raw_get_signed. gdb: 2016-11-14 Yao Qi * regcache.c (regcache_raw_get_signed): New function. * regcache.h (regcache_raw_get_signed): Declare. --- gdb/regcache.c | 13 +++++++++++++ gdb/regcache.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/gdb/regcache.c b/gdb/regcache.c index a5c90a6..1fcf933 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -742,6 +742,19 @@ regcache_raw_write_unsigned (struct regcache *regcache, int regnum, regcache_raw_write (regcache, regnum, buf); } +LONGEST +regcache_raw_get_signed (struct regcache *regcache, int regnum) +{ + LONGEST value; + enum register_status status; + + status = regcache_raw_read_signed (regcache, regnum, &value); + if (status == REG_UNAVAILABLE) + throw_error (NOT_AVAILABLE_ERROR, + _("Register %d is not available"), regnum); + return value; +} + enum register_status regcache_cooked_read (struct regcache *regcache, int regnum, gdb_byte *buf) { diff --git a/gdb/regcache.h b/gdb/regcache.h index 1bb0ce0..19ea976 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -66,6 +66,9 @@ extern void regcache_raw_write_signed (struct regcache *regcache, extern void regcache_raw_write_unsigned (struct regcache *regcache, int regnum, ULONGEST val); +extern LONGEST regcache_raw_get_signed (struct regcache *regcache, + int regnum); + /* Set a raw register's value in the regcache's buffer. Unlike regcache_raw_write, this is not write-through. The intention is allowing to change the buffer contents of a read-only regcache -- 1.9.1