From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13681 invoked by alias); 26 Aug 2014 13:18:44 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 13671 invoked by uid 89); 26 Aug 2014 13:18:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 26 Aug 2014 13:18:41 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1XMGdx-00067S-K7 from Luis_Gustavo@mentor.com ; Tue, 26 Aug 2014 06:18:37 -0700 Received: from SVR-ORW-FEM-06.mgc.mentorg.com ([147.34.97.120]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 26 Aug 2014 06:18:37 -0700 Received: from [172.30.8.175] (147.34.91.1) by SVR-ORW-FEM-06.mgc.mentorg.com (147.34.97.120) with Microsoft SMTP Server id 14.2.247.3; Tue, 26 Aug 2014 06:18:36 -0700 Message-ID: <53FC8928.8000505@codesourcery.com> Date: Tue, 26 Aug 2014 13:18:00 -0000 From: Luis Machado Reply-To: User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Peng Fan , "gdb@sourceware.org" Subject: Re: GDB Remote debug: Why several "$Z0,address,length" msg when only set one breakpoint? References: <53FC2FC1.9080600@gmail.com> In-Reply-To: <53FC2FC1.9080600@gmail.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00123.txt.bz2 On 08/26/2014 03:57 AM, Peng Fan wrote: > Hi, > > Currently, I am hacking uboot arm kgdb and adding breakpoint support. > > The steps is as following: > (gdb) b do_bootz > Breakpoint 1, do_bootz (cmdtp=0x8784ca14 <_u_boot_list_2_cmd_2_bootz>, flag=0, argc=1, argv=0xbf552a20) at common/cmd_bootm.c:1928 > (gdb) c > Continuing. > Sending packet: $m87809580,4#7a...Ack > Packet received: f0452de9 > Sending packet: $m87809580,4#7a...Ack > Packet received: f0452de9 > Sending packet: $Z0,87809584,4#c7...Ack > Packet received: OK > Sending packet: $Hc0#db...Ack > Packet received: > Sending packet: $c#63...Ack > Packet received: T050f:84958087;0d:a41355bf; > Sending packet: $z0,87809584,4#e7...Ack > Packet received: OK > Sending packet: $qTStatus#49...Ack > Packet received: > Sending packet: $Z0,87800000,4#ad...Ack > Packet received: OK > Sending packet: $Z0,87809580,4#c3...Ack > Packet received: OK > Sending packet: $Hc0#db...Ack > Packet received: > Sending packet: $c#63...Ack > > Actually the breakpoint is at 0x87809580, but why first set breakpoint at 0x87809584 then remove it then set breakpoint at 0x87809580? > > Also the first time set a breakpoint then continue. > (gdb) c > Continuing. > Sending packet: $qTStatus#49...Ack > Packet received: > Sending packet: $Z0,87800000,4#ad...Ack > Packet received: OK > Packet Z0 (software-breakpoint) is supported > Sending packet: $Z0,87809580,4#c3...Ack > Packet received: OK > Sending packet: $vCont?#49...Ack > Packet received: > Packet vCont (verbose-resume) is NOT supported > Sending packet: $Hc0#db...Ack > Packet received: > Sending packet: $c#63...Ack > > why two Z0 here? I only set break at 0x87809580, but gdb send a break set at 0x87800000 which is the beginning of the elf entry. > > Thanks. > Peng. > > ARM does not have hardware single-stepping support, so GDB needs to simulate it with continue requests and breakpoints. Regarding additional breakpoints, GDB has its own internal breakpoints, so your session may not be restricted to the breakpoints you created. On third reason, depending on the mode, GDB inserts and removes breakpoints with every program stop.