From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14802 invoked by alias); 21 Jan 2010 10:01:49 -0000 Received: (qmail 14060 invoked by uid 22791); 21 Jan 2010 10:01:48 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-fx0-f212.google.com (HELO mail-fx0-f212.google.com) (209.85.220.212) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Jan 2010 10:01:43 +0000 Received: by fxm4 with SMTP id 4so3919090fxm.12 for ; Thu, 21 Jan 2010 02:01:40 -0800 (PST) Received: by 10.223.3.135 with SMTP id 7mr1215702fan.21.1264068100350; Thu, 21 Jan 2010 02:01:40 -0800 (PST) Received: from ?192.168.2.99? (cpc2-cmbg8-0-0-cust61.cmbg.cable.ntl.com [82.6.108.62]) by mx.google.com with ESMTPS id 22sm1068252fkq.54.2010.01.21.02.01.37 (version=SSLv3 cipher=RC4-MD5); Thu, 21 Jan 2010 02:01:38 -0800 (PST) Message-ID: <4B582A02.2040501@gmail.com> Date: Thu, 21 Jan 2010 10:01:00 -0000 From: Dave Korn User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Jie Zhang CC: gdb@sourceware.org Subject: Re: Reset breakpoint after load? References: <4B5560E0.3080901@analog.com> In-Reply-To: <4B5560E0.3080901@analog.com> Content-Type: text/plain; charset=ISO-8859-1 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/msg00170.txt.bz2 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. Something is wrong here. Before the inferior is started, gdb should be looking at the prologue bytes from the executable image file, not the inferior memory. Is something going wrong in gdb_comm_file_cmd()? cheers, DaveK