This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [Patch, microblaze]: Add support of microblaze software single stepping


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]