From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#18961: gud Cannot find bounds of current function, but gdb works Date: Thu, 06 Nov 2014 18:12:43 +0200 Message-ID: <83lhnotiis.fsf@gnu.org> References: <20141105202656.GA2831@fifteen> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1415290409 10747 80.91.229.3 (6 Nov 2014 16:13:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Nov 2014 16:13:29 +0000 (UTC) Cc: 18961@debbugs.gnu.org To: Evgeniy Dushistov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 06 17:13:23 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XmPgW-0002N1-2b for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Nov 2014 17:13:20 +0100 Original-Received: from localhost ([::1]:54767 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmPgV-0007Bl-8W for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Nov 2014 11:13:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmPgK-0006y5-B8 for bug-gnu-emacs@gnu.org; Thu, 06 Nov 2014 11:13:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XmPgE-0004XI-95 for bug-gnu-emacs@gnu.org; Thu, 06 Nov 2014 11:13:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54799) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmPgE-0004XE-60 for bug-gnu-emacs@gnu.org; Thu, 06 Nov 2014 11:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XmPgD-0005XX-Qa for bug-gnu-emacs@gnu.org; Thu, 06 Nov 2014 11:13:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Nov 2014 16:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18961 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18961-submit@debbugs.gnu.org id=B18961.141529037021274 (code B ref 18961); Thu, 06 Nov 2014 16:13:01 +0000 Original-Received: (at 18961) by debbugs.gnu.org; 6 Nov 2014 16:12:50 +0000 Original-Received: from localhost ([127.0.0.1]:52012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XmPg1-0005X3-Dg for submit@debbugs.gnu.org; Thu, 06 Nov 2014 11:12:49 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:55597) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XmPfy-0005Wr-9n for 18961@debbugs.gnu.org; Thu, 06 Nov 2014 11:12:47 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NEM00000KS8SX00@a-mtaout20.012.net.il> for 18961@debbugs.gnu.org; Thu, 06 Nov 2014 18:12:44 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NEM000X0L18OS20@a-mtaout20.012.net.il>; Thu, 06 Nov 2014 18:12:44 +0200 (IST) In-reply-to: <20141105202656.GA2831@fifteen> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:95623 > Date: Wed, 5 Nov 2014 23:26:56 +0300 > From: Evgeniy Dushistov > > I try debug such simple C++ code( > from here: http://www.boost.org/doc/libs/1_55_0/libs/tokenizer/introduc.htm): > > #include > #include > #include > > int main(){ > using namespace std; > using namespace boost; > string s = "This is, a test"; > tokenizer<> tok(s); > for(tokenizer<>::iterator beg=tok.begin(); beg!=tok.end();++beg){ > cout << *beg << "\n"; > } > } > > compiled with "g++ -Wall -ggdb test.cpp". You should use "-ggdb -g3" for better results. (Actually, -ggdb should be redundant with modern GCC versions. But -g3 is still highly recommended.) > using "Next Line" I reach > for(tokenizer<>::iterator beg=tok.begin(); beg!=tok.end();++beg) > and the I use "Step Line" > class iterator_facade in /usr/include/boost/iterator/iterator_facade.hpp, > after that "Step Line" stop working, > and gud says "Cannot find bounds of current function", This message comes from GDB, not from Emacs. Anyway, I cannot reproduce this problem, stepping by clicking the Step Line button works for me with that example Boost program. I used GDB 7.8, so I suggest that you upgrade your GDB and try again. Debugging of C++ programs gets significant improvements with each GDB release, so using the latest one (GDB 7.8.1 was released a few days ago) is recommended. I also used the latest Boost, but I doubt that this could be the reason. > But if I run the same binary in gdb without emacs mediation, > and use step on the same line, all works fine, I can step until > the end of program, also simple script like this reach the end of main > without any problems in plain gdb: Please note that Emacs generally uses somewhat different commands, not the ones you'd use from CLI, and also sends a lot of commands to GDB to receive the state of the debuggee, so comparison with CLI sessions are not always the way to blame Emacs.