Author Topic: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.  (Read 34540 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5489
Get quick announcements through the RSS feed http://www.codeblocks.org/nightly/CodeBlock_RSS.xml

Before you use a nightly make sure you understand how it works.

A link to the unicode windows wxWidget dll for Code::Blocks : http://prdownload.berlios.de/codeblocks/wxmsw28u_gcc_cb_wx2810_gcc441.7z

For those who might need this one (when no MingW installed on your system) : the mingw10m.dll : http://prdownload.berlios.de/codeblocks/mingwm10_gcc441.7z

The 24 August 2010 build is out.
  - Windows :
   http://prdownload.berlios.de/codeblocks/CB_20100824_rev6527_DEBUGGER_BRANCH_win32.7z
  - Linux :
   none

Important changes compared to regular nightly:

* The stop button was split to pause and stop
* New watches window using wxPropGrid
*      Rename the watch with the Insert key (don't work on windows, some help will be appreciated)
*      Delete key in Breakpoints window deletes the selected breakpoint
*      Drag/drop from the editor to the watches window
*      Made adding watches from the context menu in the editor to be easier: select some text -> right click -> add watch
*  The evaluate tooltip should not show outside the editor window, also should not show if you move the mouse from the initial position
* Added "Set next statement command", please use with care and understanding ( http://sunsite.ualberta.ca/Documentation/Gnu/gdb-4.18/html_node/gdb_93.html )
* Switch to frame does work now (added option to make double clicking switch to frame or jump to frame in the call stack window)
* Fixed bug https://developer.berlios.de/bugs/?func=detailbug&bug_id=16146&group_id=5358
* Fixed bug 13972 ( http://developer.berlios.de/bugs/?func=detailbug&bug_id=13972&group_id=5358 )
* If the build fail a message box is shown "Build failed. Do you want to debug, anyway?", it is useful for debugging unittest projects that have failing tests
* Attaching and detaching should work better (BUG: attaching to codeblocks doesn't at the moment)
* Ensure visible the selected/active frame in the backtrace window
* Run host it terminal ( Project -> Set programs' arguments)
* Close the console when the user unloads the project/closes C::B, while the debugger is running
* Clicking on a frame that points to a missing file now shows an info window with the error message
* Catching exceptions should work now
* Added command to disable the feature of gdb to shorten the lines in the output from commands.
    This should improve the reliability of the plugin.


Note: Watch parsing prints an error message in the watches window if the parsing fails. If you see this string please report it as a bug.

THIS IS A SPECIAL TEST BUILD OF REFACTORINGS CARRIED OUT ON THE DEBUGGER BRANCH IN OUR SVN.
FOCUS IS ON ENHANCED DEBUGGING USABILITY.

Give your feedback on this version only in this thread, don't mix it with the regular nightly please.

Once we don't have any blockers on this version,we will merge the changes into trunk and it will be part of the regular nightlies.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #1 on: August 24, 2010, 09:13:50 pm »
Some notes:

1. Please look for regressions! A regression is a bug that is not present in the regular nightly, but present in this one.
Only regressions will be blockers (I think:) )
2. When you find a bug, please paste the debugger's debug log ( Settings -> Compiler & Debugger -> Debugger -> Display debugger's log ).
Please use code tags, in order to keep the readability of your posts.
3. I think GCC >=4.5.x requires GDB 7.0+, so if you're using this version of GCC please update your GDB

Known problems:
1. Local variables are not shown in the watches window.
        Reason: I wanted to move them to separate window, but wxAUI doesn't support moving windows from on notebook to another,
                     so I've just removed them and I'm waiting wx guys to implement this feature (go bug them on their mailing list :) )
2. Function arguments are not shown in the watches windows.
        Reason: same as above
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5489
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #2 on: August 24, 2010, 09:31:45 pm »
can we have in the watches window, several tabs (kind of like in the project management window), we could have a tab with manual added watches, and one with function arguments and locals.
We could even have a second tab with manual added watches ;-) [I think MSVC has this]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #3 on: August 24, 2010, 09:38:15 pm »
Yes, we can, wxPG supports pages (see the wxPG in the wxSmith), but I don't like them solution...

MSVC has Watches1, Watches2, Watches3,Watches4, Autos, Locals, but they can dock any window inside any notebook/zone, it is pretty powerful...
« Last Edit: August 24, 2010, 09:40:17 pm by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5489
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #4 on: August 24, 2010, 09:49:07 pm »
well it could  be a temp solution until you can implement the functionality like you prefer once wx dev's have added what you want. The latter could take some time I guess. The former could enhance the debugging experience in the short term ?

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #5 on: August 25, 2010, 04:11:58 am »
In the watches(new), could you let's support tooltip for every value? :)

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #6 on: August 25, 2010, 04:19:07 am »
About local variables and function arguments, I personally think that can be shown in the same watch.
And we can add  a column named "variables scope".
There can be:
Local variables
Global variables
Function arguments
Member variables
...

Any comments?

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #7 on: August 25, 2010, 04:21:26 am »
Or, add a small picture in the front of the variables, shown the scope?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5905
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #8 on: August 25, 2010, 04:57:58 am »
MSVC has Watches1, Watches2, Watches3,Watches4, Autos, Locals, but they can dock any window inside any notebook/zone, it is pretty powerful...

several watches have a performance advantage compared to one watches. that means, only the variables in "active front watch window" need to be "refreshed" when you do a step or something similar.

As refresh a variable need some communication with gdb, then it takes a lot of time if you have many watch variables in an active watch window.

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ptDev

  • Almost regular
  • **
  • Posts: 222
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #9 on: August 25, 2010, 08:29:19 am »
MSVC has Watches1, Watches2, Watches3,Watches4, Autos, Locals, but they can dock any window inside any notebook/zone, it is pretty powerful...

several watches have a performance advantage compared to one watches. that means, only the variables in "active front watch window" need to be "refreshed" when you do a step or something similar.

As refresh a variable need some communication with gdb, then it takes a lot of time if you have many watch variables in an active watch window.


What if we had several "watched variable lists", selectable via a combobox in the watches window? This way we could have as many sets of symbols as we desire. Would be very powerful.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #10 on: August 25, 2010, 11:36:27 am »
Please concentrate on bugs, when we get to re-adding the local/args to the watches I could/will start a discussion...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Orgulas

  • Single posting newcomer
  • *
  • Posts: 4
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #11 on: August 25, 2010, 08:17:14 pm »
What about a combined "Debug/Continue" menu command? Just like the toolbar button, but with the ability to assign a hot key. Been missing it for so long...
Code
main(int f,int*v){for(f=fopen(*++v,"r");*v=~getc(f);)putchar(~*v);}

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #12 on: August 25, 2010, 08:51:10 pm »
What about a combined "Debug/Continue" menu command? Just like the toolbar button, but with the ability to assign a hot key. Been missing it for so long...
This is a feature request, we can start another thread for such things :)

Regressions only please:)

p.s. I've added this to my TODO
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Max

  • Guest
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #13 on: August 31, 2010, 09:38:00 pm »
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

Code

#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

Quote

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

Quote
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
« Last Edit: August 31, 2010, 09:43:46 pm by MaxGaspa »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5489
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #14 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 ?

Max

  • Guest
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #15 on: August 31, 2010, 10:07:52 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 ?

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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #16 on: September 01, 2010, 12:11:06 am »
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();

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

Thanks for the report :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5489
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #17 on: September 01, 2010, 09:57:48 am »
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 ?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #18 on: September 01, 2010, 10:51:45 am »
Quote
In case of an uncheck it would be nice to see a list of occurred exceptions in the debug log.
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.
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 ?
Hm, should test with a trunk version...
Can you test debugger's branch + the patch?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5489
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #19 on: September 01, 2010, 11:05:47 am »
Quote
MSVC2008 express, and there the debugger continued, but in the debug log panel one could see the exceptions that had occurred.
Probably this is not implemented for the CDB. Can you provide the full debugger's debug log?

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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #20 on: September 01, 2010, 11:27:14 am »
In MSVC 2008 non express, C++ exceptions are disabled by default. To enabled them go to Debug->Exceptions -> C++ exception [check the throw checkbox]
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #21 on: September 01, 2010, 10:59:36 pm »
Killerbot: I've tested the latest normal nightly and catch exceptions doesn't work...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5489
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #22 on: September 01, 2010, 11:09:44 pm »
just checked my win box : rev 5859. That one does catch exceptions, meaning when an exception is thrown the debugger stops, and the callstack show a throw at the deepest level. Can this be considered as 'working' or not ?

Max

  • Guest
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #23 on: September 01, 2010, 11:25:39 pm »
just checked my win box : rev 5859. That one does catch exceptions, meaning when an exception is thrown the debugger stops, and the callstack show a throw at the deepest level. Can this be considered as 'working' or not ?

In the end this is a developper's decision  :lol:

What I'm expecting (IMO) is to observe the most useful behaviour (the one I observed  long ago). The debuuger stops printing some information in the log panel. The perfect info (IMO) is the line of code in which the exception was thrown. 

I don't konw if that is feasible with a limited effort. The option to stay "as today" is not the preferred one (by me  :)) but is better than nothing  :)

Max
 

Max

  • Guest
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #24 on: September 02, 2010, 12:34:18 am »
Dear all,

I think to have found a bug (regression because it worked in the past).

Have a look at the image attached



Uploaded with ImageShack.us

or

http://img840.imageshack.us/img840/1463/debugger.jpg



The variable sqlStatement is a std::string containing

CREATE TABLE 1234567890123456789012345678901234567890_data (x REAL,y_1 REAL,y_2 REAL,y_3 REAL.......

In the memory dump (at the variable content's address) the content is correct. In the watches panel yhe strng's content is shown in several lines with the commas missed. The raw content of the first line (_M_p) is showing the first part of the string. Commas are missed.

I don't know if it's clear, hope this helps.

Max
« Last Edit: September 02, 2010, 12:53:13 am by MaxGaspa »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #25 on: September 02, 2010, 01:21:44 am »
MaxGapsa:
1. Please look at debugger's debug log and if the correct output is there, if it is please provide a simple project that reproduces the problem...
2. Looking at the watches window, it looks like the parser has failed to parse the watch value correctly. Test project please...

Killerbot: yes, stopping at the throw site is considered working "Catch exceptions" feature. Have you tried the patch I've provided?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Max

  • Guest
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #26 on: September 02, 2010, 09:49:00 pm »
MaxGapsa:
1. Please look at debugger's debug log and if the correct output is there, if it is please provide a simple project that reproduces the problem...

Yes in the debugger log is correct. look at



http://img42.imageshack.us/img42/3205/debugger2.jpg

Uploaded with ImageShack.us

in which I'm using the testcase attached.


2. Looking at the watches window, it looks like the parser has failed to parse the watch value correctly. Test project please...

Killerbot: yes, stopping at the throw site is considered working "Catch exceptions" feature. Have you tried the patch I've provided?

Test project attached. Set a breakpoint on line 12 and when the debugger stops there add theString to the watches. Comma disappeared.

Hope this helps

Max

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 24 August 2010 build (6527) DEBUGGER BRANCH version is out.
« Reply #27 on: September 03, 2010, 02:37:28 am »
The watch and the catch exception bugs should be fixed with this patch: http://forums.codeblocks.org/index.php/topic,10908.msg88984.html#msg88984

MaxGaspa: next time please paste the ouput from the "output" command, screenshots are harder to use (I can't copy paste them:) )
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]