From patchwork Tue Jun 17 18:12:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Kumar Agarwal X-Patchwork-Id: 1539 Received: (qmail 2750 invoked by alias); 17 Jun 2014 18:13:08 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 2733 invoked by uid 89); 17 Jun 2014 18:13:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: na01-by2-obe.outbound.protection.outlook.com Received: from mail-by2lp0237.outbound.protection.outlook.com (HELO na01-by2-obe.outbound.protection.outlook.com) (207.46.163.237) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 17 Jun 2014 18:13:06 +0000 Received: from BN1AFFO11FD045.protection.gbl (10.58.52.30) by BN1AFFO11HUB040.protection.gbl (10.58.52.151) with Microsoft SMTP Server (TLS) id 15.0.959.15; Tue, 17 Jun 2014 18:13:03 +0000 Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BN1AFFO11FD045.mail.protection.outlook.com (10.58.53.60) with Microsoft SMTP Server (TLS) id 15.0.959.15 via Frontend Transport; Tue, 17 Jun 2014 18:13:04 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-smtp1) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1Wwxsh-0006X6-Bp; Tue, 17 Jun 2014 11:13:15 -0700 From: Ajit Kumar Agarwal To: Pedro Alves , "gdb-patches@sourceware.org" CC: Michael Eager , Vinod Kathail , Vidhumouli Hunsigida , Nagaraju Mekala Subject: RE: [Patch, microblaze]: Communicate in larger blocks with the target. Date: Tue, 17 Jun 2014 18:12:58 +0000 References: <41df2189-0a72-4543-ba31-297f81e663d7@BN1AFFO11FD025.protection.gbl> <53A04753.5010102@redhat.com> <53A06E16.2020603@redhat.com> <6e827cdb-8f1d-4341-9891-78a471a4d14f@BY2FFO11FD033.protection.gbl> <53A07246.7010405@redhat.com> MIME-Version: 1.0 X-RCIS-Action: ALLOW Message-ID: <9f804e53-b4a5-4f72-9260-cdacf4fb60c5@BN1AFFO11FD045.protection.gbl> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.83; CTRY:US; IPV:NLI; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(438001)(199002)(189002)(479174003)(377454003)(377424004)(51704005)(24454002)(13464003)(83322001)(19580405001)(6806004)(44976005)(21056001)(31966008)(19580395003)(81342001)(71186001)(70736001)(4396001)(81542001)(74502001)(74662001)(80022001)(46102001)(33646001)(85852003)(83072002)(77096002)(551934003)(53416004)(1496007)(93886003)(84326002)(87936001)(512954002)(2656002)(568964001)(104016002)(31696002)(99396002)(95666004)(86362001)(50986999)(77982001)(99936001)(76482001)(64706001)(92726001)(20776003)(92566001)(54356999)(79102001)(85306003)(74316001)(76176999); DIR:OUT; SFP:; SCL:1; SRVR:BN1AFFO11HUB040; H:xsj-pvapsmtpgw01; FPR:; MLV:sfv; PTR:unknown-60-83.xilinx.com; A:1; MX:1; LANG:en; X-OriginatorOrg: xilinx.onmicrosoft.com X-Microsoft-Antispam: BL:0; ACTION:Default; RISK:Low; SCL:0; SPMLVL:NotSpam; PCL:0; RULEID: X-Forefront-PRVS: 0245702D7B Received-SPF: Pass (: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=ajit.kumar.agarwal@xilinx.com; Sorry Pedro. The ChangeLog was missing. Could you please review and let me know if its okay. [Patch, microblaze]: Use target_read_code in microblaze_fetch_instruction This patch uses target_read_code instead of target_read_memory in microblaze_fetch instruction in order to use cache memory accesses requested in target_read_code. ChangeLog: 2014-06-17 Ajit Agarwal * microblaze-tdep.c (microblaze_fetch_instruction): Use of target_read_code. Signed-off-by:Ajit Agarwal ajitkum@xilinx.com --- gdb/microblaze-tdep.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -- 1.7.1 -----Original Message----- From: Pedro Alves [mailto:palves@redhat.com] Sent: Tuesday, June 17, 2014 10:22 PM To: Ajit Kumar Agarwal; gdb-patches@sourceware.org Cc: Michael Eager; Vinod Kathail; Vidhumouli Hunsigida; Nagaraju Mekala Subject: Re: [Patch, microblaze]: Communicate in larger blocks with the target. On 06/17/2014 05:49 PM, Ajit Kumar Agarwal wrote: > > > -----Original Message----- > From: Pedro Alves [mailto:palves@redhat.com] > Sent: Tuesday, June 17, 2014 10:05 PM > To: Pedro Alves; Ajit Kumar Agarwal; gdb-patches@sourceware.org > Cc: Michael Eager; Vinod Kathail; Vidhumouli Hunsigida; Nagaraju > Mekala > Subject: Re: [Patch, microblaze]: Communicate in larger blocks with the target. > > On 06/17/2014 02:49 PM, Pedro Alves wrote: >> On 06/17/2014 10:03 AM, Ajit Kumar Agarwal wrote: >>> Please find the following patch. >>> >>> [Patch, microblaze]: Communicate in larger blocks with the target. >>> >>> Communicate in larger blocks with the target. The chunk of memory >>> will be read from the target and then used in microblaze_analyze_prologue. >>> The above process minimizes the transaction with the Debug Agent. >> >> We have core infrustructure for this now, in the form of a code cache >> that reads ahead. Could you try using it? >> All you have to do is replace target_read_memory calls that are >> actually reading code, with target_read_code calls. See i386-tdep.c >> for example. > >>> To be clear, I'm not talking about changing the new calls in your patch, but instead, to change the existing calls. Then your patch won't be necessary. > > Thanks Pedro !!. Would you mind explaining this in detail. See 0865b04a4dec8a458bee54081b5598a6268b0724. -- Pedro Alves diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c index 14c1b52..4e5b2d5 100644 --- a/gdb/microblaze-tdep.c +++ b/gdb/microblaze-tdep.c @@ -126,7 +126,7 @@ microblaze_fetch_instruction (CORE_ADDR pc) gdb_byte buf[4]; /* If we can't read the instruction at PC, return zero. */ - if (target_read_memory (pc, buf, sizeof (buf))) + if (target_read_code (pc, buf, sizeof (buf))) return 0; return extract_unsigned_integer (buf, 4, byte_order); -- 1.7.1 Thanks & Regards Ajit -----Original Message----- From: Ajit Kumar Agarwal Sent: Tuesday, June 17, 2014 11:40 PM To: 'Pedro Alves'; gdb-patches@sourceware.org Cc: Michael Eager; Vinod Kathail; Vidhumouli Hunsigida; Nagaraju Mekala Subject: RE: [Patch, microblaze]: Communicate in larger blocks with the target. Hello Pedro: Review feedback are incorporated. Could you please review and let me know if its okay. [Patch, microblaze]: Use target_read_code in microblaze_fetch_instruction This patch uses target_read_code instead of target_read_memory in microblaze_fetch instruction in order to use cache memory accesses requested in target_read_code. ChangeLog: 2014-06-17 Ajit Agarwal --- gdb/microblaze-tdep.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c index 14c1b52..4e5b2d5 100644 --- a/gdb/microblaze-tdep.c +++ b/gdb/microblaze-tdep.c @@ -126,7 +126,7 @@ microblaze_fetch_instruction (CORE_ADDR pc) gdb_byte buf[4]; /* If we can't read the instruction at PC, return zero. */ - if (target_read_memory (pc, buf, sizeof (buf))) + if (target_read_code (pc, buf, sizeof (buf))) return 0; return extract_unsigned_integer (buf, 4, byte_order);