User forums > Nightly builds

The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.

<< < (4/6) > >>

Max:

--- Quote from: killerbot on August 31, 2010, 09:46:53 pm ---what should be the behavior when an exception is thrown when running from within the debugger in CB ?
I would guess, things should continue since code was catching the exception, right ?

--- End quote ---

Well, the debugger stops, waiting for an user action without any information in the debugger panel (I can discover that an exception was thrown looking at the debugger log only). It may be a good idea to get a message in the debug panel adding any available info (from gdb) about the issue. Or should I disseminate breakpoints in every catch block?  Any advice from you on the issue is welcome.

In the past, may be last year, I got info when an exception was thrown. But using different GCC and GDB. May be CB is doing the most...

Max

oBFusCATed:
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.

--- Code: ---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();

--- End code ---

2. Yes it will be merged with trunk, but it should be tested a bit more.

Thanks for the report :)

killerbot:
well then I can say, this works on both linux and windows (windows TDM GCC 4.4 and 4.5).
I was struggling with this (had no idea the debugger could catch the exceptions).

I ran a program in the debugger and after a while it stopped/halted/paused in the debugger, and looking at the call stack it had stopped on a "throw".
Just did an experiment on linux, and when I uncheck the catch C++ exceptions, it nicely continues (did this in a small test program).

In case of an uncheck it would be nice to see a list of occurred exceptions in the debug log. I did an experiment this weekend with MSVC2008 express, and there the debugger continued, but in the debug log panel one could see the exceptions that had occurred.

What am I missing with respect to people saying it does not work, or something is missing ?

Oh yeah : this was running trunk (on my windows machine), and a trunk nightly version from long ago. So maybe it got broken afterwards ?

oBFusCATed:

--- Quote ---In case of an uncheck it would be nice to see a list of occurred exceptions in the debug log.

--- End quote ---
The uncheck disables the feature inside gdb and it doesn't stop at all, nor prints anything.
I could make it skip the messages and print something in the log.


--- Quote ---MSVC2008 express, and there the debugger continued, but in the debug log panel one could see the exceptions that had occurred.

--- End quote ---
Probably this is not implemented for the CDB. Can you provide the full debugger's debug log?


--- Quote ---Oh yeah : this was running trunk (on my windows machine), and a trunk nightly version from long ago. So maybe it got broken afterwards ?

--- End quote ---
Hm, should test with a trunk version...
Can you test debugger's branch + the patch?

killerbot:

--- Quote from: oBFusCATed on September 01, 2010, 10:51:45 am ---
--- Quote ---MSVC2008 express, and there the debugger continued, but in the debug log panel one could see the exceptions that had occurred.

--- End quote ---
Probably this is not implemented for the CDB. Can you provide the full debugger's debug log?

--- End quote ---

I mean completely in the IDE of MSVC express. Not within CB.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version