[microblaze] : Communicate in larger blocks with the target.

Message ID 9f804e53-b4a5-4f72-9260-cdacf4fb60c5@BN1AFFO11FD045.protection.gbl
State New, archived
Headers

Commit Message

Ajit Kumar Agarwal June 17, 2014, 6:12 p.m. UTC
  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 <ajitkum@xilinx.com>
    
        * 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
  

Comments

Pedro Alves June 18, 2014, 9:28 a.m. UTC | #1
On 06/17/2014 07:12 PM, Ajit Kumar Agarwal wrote:
> Sorry Pedro. The ChangeLog  was missing. Could you please review  and let me know if its okay.

Yes, looks OK to me.

Michael is the microblaze maintainer so please wait for
his comments/approval.

Thanks,
  
Michael Eager July 24, 2014, 2:29 a.m. UTC | #2
On 06/17/14 11:12, Ajit Kumar Agarwal wrote:
> 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 <ajitkum@xilinx.com>
>
>          * 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(-)
>
> 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);
>

Committed 3421196.
  

Patch

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 <ajitkum@xilinx.com>

---
 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);