all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#18961: gud Cannot find bounds of current function, but gdb works
@ 2014-11-05 20:26 Evgeniy Dushistov
  2014-11-05 20:43 ` bug#18961: gud Cannot find bounds of current function, but gdb works: version info Evgeniy Dushistov
  2014-11-06 16:12 ` bug#18961: gud Cannot find bounds of current function, but gdb works Eli Zaretskii
  0 siblings, 2 replies; 5+ messages in thread
From: Evgeniy Dushistov @ 2014-11-05 20:26 UTC (permalink / raw)
  To: 18961

I try debug such simple C++ code(
from here: http://www.boost.org/doc/libs/1_55_0/libs/tokenizer/introduc.htm):

#include<iostream>
#include<boost/tokenizer.hpp>
#include<string>

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".

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",
bt show 
#0  0x00007fffffffdd40 in ?? ()
#1  0x00007ffff7ddb678 in std::string::_Rep::_S_empty_rep_storage () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/libstdc++.so.6
#2  0x0000000000000000 in ?? ()

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:
br main
run
while true
step
end

-- 
/Evgeniy





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#18961: gud Cannot find bounds of current function, but gdb works: version info
  2014-11-05 20:26 bug#18961: gud Cannot find bounds of current function, but gdb works Evgeniy Dushistov
@ 2014-11-05 20:43 ` Evgeniy Dushistov
  2014-11-06 16:12 ` bug#18961: gud Cannot find bounds of current function, but gdb works Eli Zaretskii
  1 sibling, 0 replies; 5+ messages in thread
From: Evgeniy Dushistov @ 2014-11-05 20:43 UTC (permalink / raw)
  To: 18961

gdb 7.6.2
gcc 4.9.2
GNU Emacs 24.4.1
$ uname -a
Linux localhost 3.16.3-gentoo #1 SMP Sun Sep 28 17:15:54 MSK 2014 x86_64
Intel(R) Core(TM) i7-3740QM CPU @ 2.70GHz GenuineIntel GNU/Linux

-- 
/Evgeniy





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#18961: gud Cannot find bounds of current function, but gdb works
  2014-11-05 20:26 bug#18961: gud Cannot find bounds of current function, but gdb works Evgeniy Dushistov
  2014-11-05 20:43 ` bug#18961: gud Cannot find bounds of current function, but gdb works: version info Evgeniy Dushistov
@ 2014-11-06 16:12 ` Eli Zaretskii
  2014-11-06 20:45   ` Evgeniy Dushistov
  1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2014-11-06 16:12 UTC (permalink / raw)
  To: Evgeniy Dushistov; +Cc: 18961

> Date: Wed, 5 Nov 2014 23:26:56 +0300
> From: Evgeniy Dushistov <dushistov@mail.ru>
> 
> I try debug such simple C++ code(
> from here: http://www.boost.org/doc/libs/1_55_0/libs/tokenizer/introduc.htm):
> 
> #include<iostream>
> #include<boost/tokenizer.hpp>
> #include<string>
> 
> 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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#18961: gud Cannot find bounds of current function, but gdb works
  2014-11-06 16:12 ` bug#18961: gud Cannot find bounds of current function, but gdb works Eli Zaretskii
@ 2014-11-06 20:45   ` Evgeniy Dushistov
  2014-11-06 20:45     ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Evgeniy Dushistov @ 2014-11-06 20:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 18961

On Thu, Nov 06, 2014 at 06:12:43PM +0200, Eli Zaretskii wrote:
> 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.
> 

Thanks, gdb 7.8.1 solved problem for me.


-- 
/Evgeniy





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#18961: gud Cannot find bounds of current function, but gdb works
  2014-11-06 20:45   ` Evgeniy Dushistov
@ 2014-11-06 20:45     ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2014-11-06 20:45 UTC (permalink / raw)
  To: Evgeniy Dushistov; +Cc: 18961-done

> Date: Thu, 6 Nov 2014 23:45:05 +0300
> From: Evgeniy Dushistov <dushistov@mail.ru>
> Cc: 18961@debbugs.gnu.org
> 
> On Thu, Nov 06, 2014 at 06:12:43PM +0200, Eli Zaretskii wrote:
> > 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.
> > 
> 
> Thanks, gdb 7.8.1 solved problem for me.

OK, closing the bug.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-11-06 20:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-05 20:26 bug#18961: gud Cannot find bounds of current function, but gdb works Evgeniy Dushistov
2014-11-05 20:43 ` bug#18961: gud Cannot find bounds of current function, but gdb works: version info Evgeniy Dushistov
2014-11-06 16:12 ` bug#18961: gud Cannot find bounds of current function, but gdb works Eli Zaretskii
2014-11-06 20:45   ` Evgeniy Dushistov
2014-11-06 20:45     ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.