From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11412 invoked by alias); 22 Jan 2010 02:15:34 -0000 Received: (qmail 11404 invoked by uid 22791); 22 Jan 2010 02:15:33 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from aussmtpmrkpc120.us.dell.com (HELO aussmtpmrkpc120.us.dell.com) (143.166.82.159) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 22 Jan 2010 02:15:27 +0000 X-Loopcount0: from 12.110.134.31 Received: from unknown (HELO M31.equallogic.com) ([12.110.134.31]) by aussmtpmrkpc120.us.dell.com with SMTP; 21 Jan 2010 20:15:26 -0600 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Reset breakpoint after load? Date: Fri, 22 Jan 2010 02:15:00 -0000 Message-ID: In-Reply-To: <4B58D811.8070604@analog.com> References: <4B5560E0.3080901@analog.com> <4B582A02.2040501@gmail.com> <4B589CF2.2040304@vmware.com> <20100121211950.GA11880@caradoc.them.org> <4B58D811.8070604@analog.com> From: "Paul Koning" To: "Jie Zhang" , "Michael Snyder" , "Dave Korn" , 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/msg00178.txt.bz2 > On 01/22/2010 05:19 AM, Daniel Jacobowitz wrote: > > On Thu, Jan 21, 2010 at 10:29:06AM -0800, Michael Snyder wrote: > >>> On 19/01/2010 07:36, Jie Zhang wrote: > >>> > >>>> 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. > > > > I've had this problem on a MIPS target, too. > > > I didn't notice this issue until recently a bug in toolchain linked in > simulator libc for bare metal executable, which made this issue easily > happen. >=20 > >> I don't believe that gdb can tell when the (remote) inferior > >> is started. All gdb knows is that target remote is started. > >> Thus, if we connect to target remote and then load the image, > >> there is an interval during which gdb will attempt to read > >> the prologue bytes from un-initialized target memory. > >>... Yes, but... doesn't GDB take read-only data from the executable file rather than from the target? If so then it should not matter. That's what "set trust-readonly-sections" does. Or is it off by default? Turn it on, that's good for performance anyway. paul