From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11859 invoked by alias); 19 Jan 2010 07:36:11 -0000 Received: (qmail 11848 invoked by uid 22791); 19 Jan 2010 07:36:10 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from nwd2mail11.analog.com (HELO nwd2mail11.analog.com) (137.71.25.57) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 19 Jan 2010 07:36:06 +0000 Received: from nwd2hubcas1.ad.analog.com ([10.64.73.29]) by nwd2mail11.analog.com with ESMTP; 19 Jan 2010 02:36:04 -0500 Received: from nwd2exm5.ad.analog.com (10.64.51.20) by NWD2HUBCAS1.ad.analog.com (10.64.73.29) with Microsoft SMTP Server id 8.1.358.0; Tue, 19 Jan 2010 02:36:04 -0500 Received: from nwd2exm20.ad.analog.com ([10.64.73.20]) by nwd2exm5.ad.analog.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 19 Jan 2010 02:36:04 -0500 Received: from chinexm1.ad.analog.com ([10.99.27.42]) by nwd2exm20.ad.analog.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 19 Jan 2010 02:36:04 -0500 Received: from [10.99.29.107] ([10.99.29.107]) by chinexm1.ad.analog.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 19 Jan 2010 15:35:59 +0800 Message-ID: <4B5560E0.3080901@analog.com> Date: Tue, 19 Jan 2010 07:36:00 -0000 From: Jie Zhang User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20100114 Lightning/1.0b1 Shredder/3.0 MIME-Version: 1.0 To: gdb@sourceware.org Subject: Reset breakpoint after load? Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2010-01/txt/msg00166.txt.bz2 Hi, While testing Blackfin GCC on bare metal using gdb-comm.exp, I found a problem, which I don't know if it's a bug of gdb or by design. gdb-comm.exp sets breakpoints on exit and abort before load. The problem is that GDB tries to skip prologue according to what it reads from memory, which might contain random data since the executable has not been loaded into memory. In my case, sometimes skip_prologue might skip one or two more instructions, which happens to be an exception instruction and will trap the processor into an exception event loop after running the executable before hit the breakpoints. Currently I change gdb-comm.exp to set breakpoints after load. In this way GDB can set breakpoints in the correct addresses and our GCC testing runs fine. But Is it a good idea to ask GDB to reset breakpoints after load just as we do on connecting to a new target? Thanks, Jie