Dear Devs,
I tested in several debugging sessions the new debugger plugin. Overall (IMO) the new interface works better than before. I didn't (so far) observe any regression. Moreover a very annoying bug (crash of CB during debugging) seems disappeared. I was used to get one or two crashes for each debugging session but now no crash at all. :lol:
Two questions:
1) You wrote
* Catching exceptions should work now
but I can't agree with you :). Well it depends on the meaning of the word "work". To me it seems working as in the previous nightly.
For example
#include <iostream>
#include <stdexcept>
void throwSomething(void);
using namespace std;
int main()
{
try
{
throwSomething();
}
catch(std::runtime_error& except)
{
cout << "Hello Exceptions " << except.what() << endl;
}
cout << "This is the end" << endl;
return 0;
}
void throwSomething(void)
{
throw std::runtime_error("The Exception");
}
compiled with -Wall -fexceptions -gstabs+ has the following behavior.
In the Debugger panel
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\Development\Projects\testException\
Adding source dir: C:\Development\Projects\testException\
Adding file: obj\testException.exe
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.1
Child process PID: 948
Continuing...
Program exited normally.
Debugger finished with status 0
So no evidence of any Catching. Obviously the debugger stopped and I pressed continue. But when the debugger stops there is no info on the debugger panle, telling what is happening and where.
But in Debugger log panel I got
GNU gdb (GDB) 7.1
Copyright (C) 2010 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 "mingw32".
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 debugevents on
>>>>>>cb_gdb:
> set new-console on
>>>>>>cb_gdb:
> set disassembly-flavor att
>>>>>>cb_gdb:
> catch throw
Catchpoint 1 (throw)
>>>>>>cb_gdb:
> source C:\Codeblocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> directory C:/Development/Projects/testException/
>>>>>>cb_gdb:
> run
gdb: windows_init_thread_list
[New Thread 948.0xb68]
Catchpoint 1 (exception thrown), 0x00401610 in __cxa_throw ()
>>>>>>cb_gdb:
> set debugevents off
>>>>>>cb_gdb:
> cont
Program exited normally.
>>>>>>cb_gdb:
> quit
Does that mean " Catching exceptions should work now", or, in other words, is that the expected behavior?
2) Is there any plan to merge the new debugger into trunk? I really appreciate the lack of crashing!
Or is it planned to release, every now and then, a special nightly of the debugger branch? I don't like to use an old nightly.
Thanks and regards
Max
Added info:
Uisng MinGW GCC 4.5.0 (latest packages) with GDB 7.1, Windows XP SP3
killerbot: the idea is to stop when the exception is thrown. So the user can inspect the reason for the throw (there is a checkbox in the settings to disable this feature).
MaxGaspa:
1. Hm, it seems that it doesn't work on windows (the regex doesn't match)
Here is a patch that should fix the problem.
Index: src/plugins/debuggergdb/gdb_driver.cpp
===================================================================
--- src/plugins/debuggergdb/gdb_driver.cpp (revision 6564)
+++ src/plugins/debuggergdb/gdb_driver.cpp (working copy)
@@ -52,6 +52,8 @@
static wxRegEx reBreak3(_T("^(0x[A-Fa-f0-9]+) in (.*)"));
// Catchpoint 1 (exception thrown), 0x00007ffff7b982b0 in __cxa_throw () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/libstdc++.so.6
static wxRegEx reCatchThrow(_T("^Catchpoint ([0-9]+) \\(exception thrown\\), (0x[0-9a-f]+) in (.+) from (.+)$"));
+// Catchpoint 1 (exception thrown), 0x00401610 in __cxa_throw ()
+static wxRegEx reCatchThrowNoFile(_T("^Catchpoint ([0-9]+) \\(exception thrown\\), (0x[0-9a-f]+) in (.+)$"));
// easily match cygwin paths
//static wxRegEx reCygwin(_T("/cygdrive/([A-Za-z])/"));
@@ -1097,6 +1099,15 @@
m_Cursor.changed = true;
m_needsUpdate = true;
}
+ else if (reCatchThrowNoFile.Matches(lines[i]) )
+ {
+ m_Cursor.file = wxEmptyString;
+ m_Cursor.function= reCatchThrowNoFile.GetMatch(lines[i], 3);
+ m_Cursor.address = reCatchThrowNoFile.GetMatch(lines[i], 2);
+ m_Cursor.line = -1;
+ m_Cursor.changed = true;
+ m_needsUpdate = true;
+ }
}
}
buffer.Clear();
2. Yes it will be merged with trunk, but it should be tested a bit more.
Thanks for the report :)