From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11734 invoked by alias); 11 Mar 2013 12:52:53 -0000 Received: (qmail 11723 invoked by uid 22791); 11 Mar 2013 12:52:52 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL,BAYES_00,FROM_12LTRDOM,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 Mar 2013 12:52:42 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1UF2DZ-0006k7-PQ from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Mon, 11 Mar 2013 05:52:41 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 11 Mar 2013 05:52:41 -0700 Received: from qiyao.dyndns.org.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.1.289.1; Mon, 11 Mar 2013 05:52:40 -0700 From: Yao Qi To: Subject: [PATCH 0/7] Range stepping Date: Mon, 11 Mar 2013 12:52:00 -0000 Message-ID: <1363006291-13334-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes 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 X-SW-Source: 2013-03/txt/msg00450.txt.bz2 Hi, When user types "next" command on the following line of source, a = b + c + d * e - a; GDB will single step every instruction belongs to this source line and stop when program goes to the next line, the following is the assembly of this source line 0x08048434 <+65>: mov 0x1c(%esp),%eax 0x08048438 <+69>: mov 0x30(%esp),%edx 0x0804843c <+73>: add %eax,%edx 0x0804843e <+75>: mov 0x18(%esp),%eax 0x08048442 <+79>: imul 0x2c(%esp),%eax 0x08048447 <+84>: add %edx,%eax 0x08048449 <+86>: sub 0x34(%esp),%eax 0x0804844d <+90>: mov %eax,0x34(%esp) 0x08048451 <+94>: mov 0x1c(%esp),%eax the following will happen between GDB and GDBserver in remote debugging, --> vCont;s:p2e13.2e13;c <-- T0505:68efffbf;04:30efffbf;08:3c840408;thread:p2e13.2e13;core:1; --> vCont;s:p2e13.2e13;c <-- T0505:68efffbf;04:30efffbf;08:3e840408;thread:p2e13.2e13;core:2; --> vCont;s:p2e13.2e13;c <-- T0505:68efffbf;04:30efffbf;08:42840408;thread:p2e13.2e13;core:2; --> vCont;s:p2e13.2e13;c <-- T0505:68efffbf;04:30efffbf;08:47840408;thread:p2e13.2e13;core:0; --> vCont;s:p2e13.2e13;c <-- T0505:68efffbf;04:30efffbf;08:49840408;thread:p2e13.2e13;core:0; --> vCont;s:p2e13.2e13;c <-- T0505:68efffbf;04:30efffbf;08:4d840408;thread:p2e13.2e13;core:0; --> vCont;s:p2e13.2e13;c <-- T0505:68efffbf;04:30efffbf;08:51840408;thread:p2e13.2e13;core:0; There are some round-trip between GDB and GDBserver. Isn't it boring and inefficient? so GDB has to say something different to GDBserver, that is, "keep stepping and report a stop to me until program goes out of the range of [0x08048434, 0x08048451)" then, the RSP traffic looks like this, --> vCont;r8048434,8048451:p2db0.2db0;c <-- T0505:68efffbf;04:30efffbf;08:51840408;thread:p2db0.2db0;core:1; As we can see, GDB tells GDBserver a range of stepping, and GDBserver only sends stop reply back when programs goes out of the range. The number of packets is reduced dramatically, and as a result, the performance of stepping a source line is improved. We call it "range stepping". In this patch series, we add range stepping support in GDBserver on x86/linux and in GDB. GDB is able to send "vCont;r" packet for other remote stubs if "vCont;r" is supported. We tested GDB with GDBserver on x86_64-linux, and also test mips-sde-elf GDB with a stub understands range stepping. No regressions. Is it OK after the release branch is created? -- 1.7.7.6