From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82303 invoked by alias); 14 Nov 2018 22:35:59 -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 82282 invoked by uid 89); 14 Nov 2018 22:35:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=morgan, Morgan X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 14 Nov 2018 22:35:57 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id wAEMZpEV022766 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 14 Nov 2018 17:35:55 -0500 Received: by simark.ca (Postfix, from userid 112) id 336421E93F; Wed, 14 Nov 2018 17:35:51 -0500 (EST) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 1417D1E182; Wed, 14 Nov 2018 17:35:50 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 14 Nov 2018 22:35:00 -0000 From: Simon Marchi To: Bill Morgan Cc: gdb@sourceware.org Subject: Re: arm remote step using software breakpoints doesn't finish the step In-Reply-To: References: Message-ID: <6527be25458327577a69fa4e8bd01b7d@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg00004.txt.bz2 On 2018-11-05 19:24, Bill Morgan wrote: > On Mon, Nov 5, 2018 at 11:42 AM Bill Morgan > > wrote: > >> For some reason GDB is setting breakpoints in an order that is causing >> a >> step to never finish. >> >> It sets a breakpoint at 0x22637fd0, then that breakpoint is hit, then >> sets >> one at 0x22637fd4, then that one is hit, then it puts one back at >> 0x22637fd0 again and the remote code runs until it loops back into >> this >> function again and fd0 is hit again, then sets bp at 0x22637fd4 again, >> etc., so the result is that the step never finishes. >> >> I'm wondering why it didn't set one at fd8. >> >> Any ideas? >> > > I found an issue in my remote stub. I had multiple threads in the > address > space with the breakpoint. > > Thread 0x1f was current, but 0x1e was resuming first and hitting the > stepping breakpoint, so GDB kept trying to get 0x1f to hit the > breakpoint > for the step. > > I changed to always resume the current thread first so it has a chance > to > hit the stepping breakpoint. Hi Bill, Good to know you managed to solve it. You can always look at how gdbserver does to get inspiration. I know that in some cases, it randomizes the order in which it processes events to avoid starving threads like that. Simon