From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: gdb does not stop on breakpoint in emacs, but does stop in commandline mode Date: Thu, 28 Dec 2017 19:43:54 +0200 Message-ID: <83zi62g339.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1514482918 6257 195.159.176.226 (28 Dec 2017 17:41:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 28 Dec 2017 17:41:58 +0000 (UTC) Cc: emacs-devel@gnu.org To: John Murray Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 28 18:41:54 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eUcBh-0000mH-To for ged-emacs-devel@m.gmane.org; Thu, 28 Dec 2017 18:41:50 +0100 Original-Received: from localhost ([::1]:59696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUcDd-0006ve-LW for ged-emacs-devel@m.gmane.org; Thu, 28 Dec 2017 12:43:49 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUcDW-0006v0-VN for emacs-devel@gnu.org; Thu, 28 Dec 2017 12:43:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eUcDS-0000WM-8x for emacs-devel@gnu.org; Thu, 28 Dec 2017 12:43:42 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57360) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUcDS-0000W3-2Z; Thu, 28 Dec 2017 12:43:38 -0500 Original-Received: from [176.228.60.248] (port=2050 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eUcDR-0008Up-Fc; Thu, 28 Dec 2017 12:43:37 -0500 In-reply-to: (message from John Murray on Thu, 28 Dec 2017 07:58:45 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:221444 Archived-At: > From: John Murray > Date: Thu, 28 Dec 2017 07:58:45 -0700 > > I set a breakpoint in a shared library in gdb on emacs run the program and the breakpoint is ignored. > > If I follow the same procedures in gdb from the command line, gdb stops at the breakpoint. > > emacs version: 25.3.1 > gdb version: 7.2-75.e16 > gdb-mi.el loaded > > More detail: > > I start gdb in emacs using the command: > > gdb -i=mi /path to executable/executable > > > break main > > run > > info func .*ProcessCommand.* > ... > [address of desired function] > > > break *[address of the desired funciton] > > continue > > Using this sequence inside emacs, gdb ignores the breakpoint. > Using this sequence using gdb from the command line, the code stops at the breakpoint. > > I note that the function is in a shared library. I couldn't reproduce this with GDB 7.8.1 and the current emacs-26 branch of the Emacs Git repository: your recipe works for me both inside and outside Emacs. Not sure that the newer versions are the reason, though. However, GDB 7.2 is quite old, so maybe try to upgrade that first. (For the record, I tried debugging Emacs, and set a breakpoint at inflateEnd, which is a zlib function. Then I invoked zlib-decompress-region to trigger the breakpoint.)