User forums > Using Code::Blocks
Debugging cursor disappearing
oBFusCATed:
Can you paste the debugger's debug log? You should enable it in Settings->Debugger->Common.
Léa Massiot:
Here it is...
--- Code: ---LD_LIBRARY_PATH=.:/usr/local/dbxml-2.5.16/install/lib:/usr/local/lib/
Command-line: /usr/bin/gdb -nx -fullname -quiet -args /path/to/my/cb/project/bin/Debug/my_cb_project
Working dir : /my/working/dir/my_cb_project
Reading symbols from /path/to/my/cb/project/bin/Debug/my_cb_project...done.
(gdb)
> set prompt >>>>>>cb_gdb:
>>>>>>cb_gdb:
> show version
GNU gdb (GDB) 7.0.1-debian
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set print elements -1
>>>>>>cb_gdb:
> set disassembly-flavor intel
>>>>>>cb_gdb:
> catch throw
Function "__cxa_throw" not defined.
Catchpoint 1 (throw)
>>>>>>cb_gdb:
> source /usr/share/codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> directory /path/to/my/cb/project/
>>>>>>cb_gdb:
> run
[Thread debugging using libthread_db enabled]
Catchpoint 1 (exception thrown), 0x00007ffff6678230 in __cxa_throw () from /usr/lib/libstdc++.so.6
>>>>>>cb_gdb:
> bt 30
#0 0x00007ffff6678230 in __cxa_throw () from /usr/lib/libstdc++.so.6
#1 0x00007ffff6e9a234 in DbXml::SyntaxDatabase::SyntaxDatabase(DbXml::Syntax const*, __db_env*, DbXml::Transaction*, std::string const&, bool, DbXml::ContainerConfig const&, bool) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#2 0x00007ffff6e405ae in DbXml::Container::openIndexDbs(DbXml::Transaction*, DbXml::ContainerConfig const&) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#3 0x00007ffff6e45dc0 in DbXml::Container::openInternal(DbXml::Transaction*, DbXml::ContainerConfig const&, bool) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#4 0x00007ffff6e47d7a in DbXml::Container::Container(DbXml::Manager&, std::string const&, DbXml::Transaction*, DbXml::ContainerConfig const&, bool) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#5 0x00007ffff6e80fdb in DbXml::Manager::ContainerStore::findContainer(DbXml::Manager&, std::string const&, DbXml::Transaction*, DbXml::ContainerConfig const&, bool) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#6 0x00007ffff6e81183 in DbXml::Manager::openContainer(std::string const&, DbXml::Transaction*, DbXml::ContainerConfig const&, bool) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#7 0x00007ffff6eabf48 in DbXml::XmlManager::createContainer(std::string const&) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#8 0x0000000000402af2 in AClass::aMethod (this=0x60bd60) at /path/to/my/cb/project/src/AClass.cpp:71
#9 0x00000000004022d2 in main (argc=1, argv=0x7fffffffe308) at /path/to/my/cb/project/main.cpp:40
>>>>>>cb_gdb:
> frame 8
#8 0x0000000000402af2 in AClass::aMethod (this=0x60bd60) at /path/to/my/cb/project/src/AClass.cpp:71
/path/to/my/cb/project/src/AClass.cpp:71:1299:beg:0x402af2
>>>>>>cb_gdb:
> next
Single stepping until exit from function __cxa_throw,
which has no line number information.
Catchpoint 1 (exception thrown), 0x00007ffff6678230 in __cxa_throw () from /usr/lib/libstdc++.so.6
>>>>>>cb_gdb:
> bt 30
#0 0x00007ffff6678230 in __cxa_throw () from /usr/lib/libstdc++.so.6
#1 0x00007ffff6e9a234 in DbXml::SyntaxDatabase::SyntaxDatabase(DbXml::Syntax const*, __db_env*, DbXml::Transaction*, std::string const&, bool, DbXml::ContainerConfig const&, bool) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#2 0x00007ffff6e405ae in DbXml::Container::openIndexDbs(DbXml::Transaction*, DbXml::ContainerConfig const&) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#3 0x00007ffff6e45dc0 in DbXml::Container::openInternal(DbXml::Transaction*, DbXml::ContainerConfig const&, bool) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#4 0x00007ffff6e47d7a in DbXml::Container::Container(DbXml::Manager&, std::string const&, DbXml::Transaction*, DbXml::ContainerConfig const&, bool) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#5 0x00007ffff6e80fdb in DbXml::Manager::ContainerStore::findContainer(DbXml::Manager&, std::string const&, DbXml::Transaction*, DbXml::ContainerConfig const&, bool) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#6 0x00007ffff6e81183 in DbXml::Manager::openContainer(std::string const&, DbXml::Transaction*, DbXml::ContainerConfig const&, bool) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#7 0x00007ffff6eabf48 in DbXml::XmlManager::createContainer(std::string const&) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#8 0x0000000000402af2 in AClass::aMethod (this=0x60bd60) at /path/to/my/cb/project/src/AClass.cpp:71
#9 0x00000000004022d2 in main (argc=1, argv=0x7fffffffe308) at /path/to/my/cb/project/main.cpp:40
>>>>>>cb_gdb:
> frame 8
#8 0x0000000000402af2 in AClass::aMethod (this=0x60bd60) at /path/to/my/cb/project/src/AClass.cpp:71
/path/to/my/cb/project/src/AClass.cpp:71:1299:beg:0x402af2
>>>>>>cb_gdb:
> bt 30
#0 0x00007ffff6678230 in __cxa_throw () from /usr/lib/libstdc++.so.6
#1 0x00007ffff6e9a234 in DbXml::SyntaxDatabase::SyntaxDatabase(DbXml::Syntax const*, __db_env*, DbXml::Transaction*, std::string const&, bool, DbXml::ContainerConfig const&, bool) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#2 0x00007ffff6e405ae in DbXml::Container::openIndexDbs(DbXml::Transaction*, DbXml::ContainerConfig const&) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#3 0x00007ffff6e45dc0 in DbXml::Container::openInternal(DbXml::Transaction*, DbXml::ContainerConfig const&, bool) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#4 0x00007ffff6e47d7a in DbXml::Container::Container(DbXml::Manager&, std::string const&, DbXml::Transaction*, DbXml::ContainerConfig const&, bool) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#5 0x00007ffff6e80fdb in DbXml::Manager::ContainerStore::findContainer(DbXml::Manager&, std::string const&, DbXml::Transaction*, DbXml::ContainerConfig const&, bool) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#6 0x00007ffff6e81183 in DbXml::Manager::openContainer(std::string const&, DbXml::Transaction*, DbXml::ContainerConfig const&, bool) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#7 0x00007ffff6eabf48 in DbXml::XmlManager::createContainer(std::string const&) () from /usr/local/dbxml-2.5.16/install/lib/libdbxml-2.5.so
#8 0x0000000000402af2 in AClass::aMethod (this=0x60bd60) at /path/to/my/cb/project/src/AClass.cpp:71
#9 0x00000000004022d2 in main (argc=1, argv=0x7fffffffe308) at /path/to/my/cb/project/main.cpp:40
>>>>>>cb_gdb:
> frame 8
#8 0x0000000000402af2 in AClass::aMethod (this=0x60bd60) at /path/to/my/cb/project/src/AClass.cpp:71
/path/to/my/cb/project/src/AClass.cpp:71:1299:beg:0x402af2
>>>>>>cb_gdb:
> next
Single stepping until exit from function __cxa_throw,
which has no line number information.
[...] (sixteen times)
END OF aMethod()
END
Program exited normally.
>>>>>>cb_gdb:
> quit
--- End code ---
It's not clear to me what's wrong...
Thanks and best regards,
--
Léa
oBFusCATed:
You've hit an exception and C::B is catching it. Then it switches to the first valid frame.
But if you use the step command it doesn't continue to to the next line, but to the next line in the frame0, which is up in the stack, but you don't have sources for it.
You have two solutions here:
1. disable the catch c++ exceptions option
2. disable the option to switch to the first valid frame
Léa Massiot:
Hello,
Thank you for your answer.
--- Quote from: oBFusCATed ---You've hit an exception and C::B is catching it. Then it switches to the first valid frame. But if you use the step command it doesn't continue to the next line, but to the next line in the frame0, which is up in the stack, but you don't have sources for it.
--- End quote ---
Ok. I see. Thank you for this explanation.
Can you please have a look at the code below?
This is the "createContainer()" method which throws an exception.
--- Code: ---void AClass::aMethod()
{
std::string s_wholeFileName = "";
s_wholeFileName.append(ms_containerPathName);
s_wholeFileName.append(ms_containerName);
try
{
XmlManager xmlManager;
XmlContainer xmlContainer = xmlManager.createContainer(s_wholeFileName);
}
catch(XmlException &xe)
{
std::cout << "XmlException: "
<< xe.what()
<< std::endl;
}
catch(...)
{
std::cout << "Something went wrong."
<< std::endl;
}
std::cout << "END OF aMethod()"
<< std::endl;
}
--- End code ---
Question 1: As an exception is being thrown (and since it's not a "XmlException"), shouldn't "we" go inside the "catch(...)" block (which is not what happens)?
Question 2: As you can see, I am outputing to "std::cout" but I can't see anything in the "Debugger" view. Where can I check for these outputs?
--- Quote from: oBFusCATed ---You have two solutions here:
1. disable the catch c++ exceptions option
2. disable the option to switch to the first valid frame
--- End quote ---
Well, I'm concerned about this exception being thrown.
What I do not understand is that an exception is being thrown and yet the program "exits normally" and it doesn't even go through the "catch(...)" block...
This is confusing to me.
1. I disabled the catch C++ exceptions option.
--- Code: ---Settings -> Debugger -> GDB debugger -> Default
Uncheck the "Catch C++ exceptions" check box.
--- End code ---
And indeed the problem disappears.
2. I re-enabled the "Catch C++ exceptions" option and disabled the option to switch to the first valid frame.
--- Code: ---Settings -> Debugger
Uncheck the "When stopping, auto-switch to the first frame with valid source info" check box.
--- End code ---
It is telling me:
--- Code: ---Unknown file: /usr/lib/libstdc++.so.6
In __cxa_throw () (/usr/lib/libstdc++.so.6)
--- End code ---
But the file "/usr/lib/libstdc++.so.6" exists.
Can you help?
Best regards,
--
Léa
oBFusCATed:
/usr/lib/libstdc++.so.6 is shared library and there is no source for it...
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version