This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [Patch, microblaze]: Add support of microblaze software single stepping
- From: Ajit Kumar Agarwal <ajit dot kumar dot agarwal at xilinx dot com>
- To: Michael Eager <eager at eagercon dot com>, Joel Brobecker <brobecker at adacore dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Pedro Alves <palves at redhat dot com>, Vinod Kathail <vinodk at xilinx dot com>, Vidhumouli Hunsigida <vidhum at xilinx dot com>, Nagaraju Mekala <nmekala at xilinx dot com>
- Date: Mon, 14 Jul 2014 10:27:50 +0000
- Subject: RE: [Patch, microblaze]: Add support of microblaze software single stepping
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=pass (sender IP is 149.199.60.83) smtp dot mailfrom=ajit dot kumar dot agarwal at xilinx dot com;
- References: <a0a86472-2b0f-4a69-bd7d-ddea295e0f5e at BN1BFFO11FD011 dot protection dot gbl> <20140707145634 dot GF6038 at adacore dot com> <35bccb81-cae6-4581-b5fd-16dea7171d28 at BN1AFFO11FD012 dot protection dot gbl> <20140711135114 dot GA4888 at adacore dot com> <ab8da1f0-cade-46f8-97e0-888662ff368e at BY2FFO11FD002 dot protection dot gbl> <53C041BD dot 4060303 at eagercon dot com>
Here are the dump of the disassembly and the output of single step command for branch with delay slot and imm instructions.
>>Please provide a disassembly of the test case and a log of the commands to gdb and gdb's output, showing stepping over imm and delay slot instructions
BRANCH WITH DELAY SLOT
Breakpoint 1, main () at ../src/helloworld.c:28
28 init_platform();
(gdb) display /i $pc
1: x/i $pc
=> 0xc00001b0 <main+16>: brlid r15, 172 // 0xc000025c
(gdb) si
init_platform () at ../src/platform.c:53
53 {
1: x/i $pc
=> 0xc000025c <init_platform>: addik r1, r1, -32
Disassembly of main :
(gdb) disassem main
Dump of assembler code for function main:
0xc00001a0 <+0>: addik r1, r1, -32
0xc00001a4 <+4>: swi r15, r1, 0
0xc00001a8 <+8>: swi r19, r1, 28
0xc00001ac <+12>: addk r19, r1, r0
0xc00001b0 <+16>: brlid r15, 172 // 0xc000025c
0xc00001b4 <+20>: or r0, r0, r0
0xc00001b8 <+24>: imm -16384
0xc00001bc <+28>: addik r5, r0, 2548
0xc00001c0 <+32>: brlid r15, 252 // 0xc00002bc
0xc00001c4 <+36>: or r0, r0, r0
0xc00001c8 <+40>: brlid r15, 196 // 0xc000028c
0xc00001cc <+44>: or r0, r0, r0
0xc00001d0 <+48>: addk r3, r0, r0
0xc00001d4 <+52>: lwi r15, r1, 0
0xc00001d8 <+56>: addk r1, r19, r0
0xc00001dc <+60>: lwi r19, r1, 28
0xc00001e0 <+64>: addik r1, r1, 32
0xc00001e4 <+68>: rtsd r15, 8
0xc00001e8 <+72>: or r0, r0, r0
WITH IMM INSTRUCTION:
(gdb) si
main () at ../src/helloworld.c:30
30 print("Hello World\n\r");
2: x/i $pc
=> 0xc00001b8 <main+24>: imm -16384
1: x/i $pc
=> 0xc00001b8 <main+24>: imm -16384
(gdb) si
0xc00001c0 30 print("Hello World\n\r");
2: x/i $pc
=> 0xc00001c0 <main+32>: brlid r15, 252 // 0xc00002bc
1: x/i $pc
=> 0xc00001c0 <main+32>: brlid r15, 252 // 0xc00002bc
>>Is there a test case which shows single stepping failing without the patch?
The same disassembly with <main> function given above
Without Single Stepping implementation there is a warning with the "warning: Remote failure reply: E01" with branch with delay slot.
(gdb) display /i $pc
1: x/i $pc
=> 0xc00001b0 <main+16>: brlid r15, 172 // 0xc000025c
(gdb) si
warning: Remote failure reply: E01
[Thread <main>] #1 stopped.
init_platform () at ../src/platform.c:53
53 {
1: x/i $pc
=> 0xc000025c <init_platform>: addik r1, r1, -32
WITH IMM instruction : There is a same warning without the single stepping patch "warning:Remote failure reply : E01".
[Thread <main>] #1 stopped.
main () at ../src/helloworld.c:30
30 print("Hello World\n\r");
1: x/i $pc
=> 0xc00001b8 <main+24>: imm -16384
(gdb)
warning: Remote failure reply: E01
[Thread <main>] #1 stopped.
0xc00001c0 in main () at ../src/helloworld.c:30
30 print("Hello World\n\r");
Thanks & Regards
Ajit
-----Original Message-----
From: Michael Eager [mailto:eager@eagercon.com]
Sent: Saturday, July 12, 2014 1:28 AM
To: Ajit Kumar Agarwal; Joel Brobecker
Cc: gdb-patches@sourceware.org; Pedro Alves; Vinod Kathail; Vidhumouli Hunsigida; Nagaraju Mekala
Subject: Re: [Patch, microblaze]: Add support of microblaze software single stepping
On 07/11/14 12:34, Ajit Kumar Agarwal wrote:
>
>>> Please also explain how this patch was tested.
>
> The changes were tested with the application for barematel with remote debug with XMD debugger( internal to Xilinx)which connects to the target and opens the gdbserver connection. Single stepping command were used for next_pc in straight line code, with imm instruction and the branch with delay Slot.
Your terminology may be a bit confusing. Gdbserver is a program (part of GDB) which runs on a platform (e.g.
Linux), and which implements the GDB Remote Serial Protocol.
XMD does not run gdbserver. It has an independent implementation of the GDB Remote Serial Protocol. It would be better to say that XMD is a remote stub.
Please provide a disassembly of the test case and a log of the commands to gdb and gdb's output, showing stepping over imm and delay slot instructions.
Is there a test case which shows single stepping failing without the patch?
Even better would be to update the gdb regression test suite with the test case.
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077