Author Topic: After upgrade to Codeblocks svn 7932 debugging does not work  (Read 9285 times)

Offline resander

  • Multiple posting newcomer
  • *
  • Posts: 49
After upgrade to Codeblocks svn 7932 debugging does not work
« on: April 15, 2012, 04:52:28 pm »
I am on Ubuntu 10.04 LTS and updated Codeblocks a couple of hours ago (Sunday 15 Apr 2012) using the GUI Update Manager on the Ubuntu System->Manager menu.

A handful of packages including Codeblocks were updated. The Codeblocks is now SVN 7932.

The main debugging functions goto cursor (F4) and stopping at breakpoint (set by F5) do not work any more.

Using F4 brings up a blank Program Console screen and the execution does not stop at the line with the cursor. Program appears to be hanging.

Breakpoints set by F5 are ignored and the program runs to completion.

The Run/Build-Run functions on the Codeblocks Build appear to be OK and run the program to completion.

Debugging was working fine before the update, so maybe the update install failed in some way. I did not notice any error messages, but I may have missed them.

I always use Jens Lody's updates that come to me via the Ubuntu Update manager. That has always worked very well in the past.
There are command-line APT functions for working with packages, but I have never used any of these. Trying without any knowledge of the various Codeblocks packages/modules might make it worse. 

I would like to initiate a complete reinstall of SVN 7932 (or an earlier svn) in the simplest possible way. How do I do that?

Ken
 

 

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: After upgrade to Codeblocks svn 7932 debugging does not work
« Reply #1 on: April 15, 2012, 10:02:13 pm »
I have the same issue here, since some time.
It should work id the command to call the terminal-emulator contains a -T (like the default one for xterm).

The followin patch should fix it (at least it works fine here with it).
I wonder why it ever has worked with terminal-emulators, that do not use -T for setting the title, but e.g. -t like gnome-terminal.

Cab other Linux (and probaly mac-) users test the patch and give some feedback here ?

Code: [Select]
Index: src/sdk/cbplugin.cpp
===================================================================
--- src/sdk/cbplugin.cpp
+++ src/sdk/cbplugin.cpp
@@ -900,7 +900,7 @@ wxString cbDebuggerPlugin::GetConsoleTty(int ConsolePid)
         do
         {
             // check for correct "sleep" line
-            if (psCmd.Contains(wxT("-T")))
+            if (psCmd.Find(ConsPidStr) != wxNOT_FOUND)
                 break; //error;wrong sleep line.
             // found "sleep 93343" string, extract tty field
             ConsTtyStr = wxT("/dev/") + psCmd.BeforeFirst(' ');

Offline resander

  • Multiple posting newcomer
  • *
  • Posts: 49
Re: After upgrade to Codeblocks svn 7932 debugging does not work
« Reply #2 on: April 16, 2012, 09:35:19 am »
Thanks Jens,

My terminal emulator setting in Codeblocks Settings->Environment is:

 gnome-terminal -t $TITLE -x

It has been like that for the last couple of years. This svn 7932 upgrade is the first to cause problems.

I tried with capital T (gnome-terminal -T $TITLE -x), but it did not start the emulator.

Also tried all permuations of xterm -t $TITLE -x with same negative outcome.

I am using a Compaq desktop with 2gb RAM and there is about 25gb free space left on the hard disk, so I don't think codeblocks in running out of resources when running on my PC. What about codeblocks stack space?

I have also tried some other projects and they are also affected by this.

I would like to install svn 7932 again to eliminate a bad install being the cause. If that still fails I need to go back to a previous version, because I totally depend on having debugging working.

Ken
P.S.
Forgot to mention that the black-on-white Gnome terminal with scrolling and cut-and-paste capability is working fine when using the Codeblocks Run and Build-Run menu commands. All my output logging come out the way I intended. That means the gnome-terminal is still invoked correctly. Could the problem be caused by the codeblocks initiating gdb?
« Last Edit: April 16, 2012, 09:55:38 am by resander »

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: After upgrade to Codeblocks svn 7932 debugging does not work
« Reply #3 on: April 16, 2012, 10:34:14 am »
Also tried all permuations of xterm -t $TITLE -x with same negative outcome.
If you try xterm with -T (capital t) it will most likely work.
The code did not chaneg for ages, and it does not work since some revisions.
We use wxString::Contains here, which is deprecated anyway.
Maybe it was case-insensitive in older wxWidgets revisions, but I don't think they have changed anything here (at least not in wx2.8).

Offline resander

  • Multiple posting newcomer
  • *
  • Posts: 49
Re: After upgrade to Codeblocks svn 7932 debugging does not work
« Reply #4 on: April 16, 2012, 07:14:50 pm »
Hi Jens,

I tried:

xterm -T:

The console window shows after placing the cursor and issuing F4, for example I can issue linux commands e.g. ls -l. For a minute or two. Then the console window disappears and the program window showing the program position where I placed the cursor appears. Stepping with F7 and Shift+F7 works. However, the console window has gone which makes console input impossible for command-line programs and tracing with printfs for application and logging cannot work.

I also noticed that the Watches function has changed. Specifying variables to be watched is easier now and the display of structs is much better. However, Function arguments and Local variables are not available from the Watches window and I could not resize the window.

The automatic display of a variable value when the cursor hovers over the variable does not work any more.

Trying xterm -T $TITLE -x:

On F4 the program window appears correctly marked and stepping is working.
No console window shows. Otherwise same as xterm -x.


gnome-terminal -t $TITLE -x again:

No console window shows on F4 and setting debugs via F5. The program runs to completion, but the debugger continues to run.

The console window appears when program is started from the Run or Build&Run menu items.

Hovering over a variable does not show its value.


Other changes:

I just noticed a new item 'Active debuggers' at the top of the Debug menu. I tried the two radio-button settings but that did not make any difference. There may be other differences too as I only use a very small subset of debug functions and may have missed them.

Q1.  The previous svn version I used is 78xx (don't remember). It worked and 7932 does not. What is new in svn 7932?



I first thought the problems were caused by a bad/failed/incomplete install of codeblocks 7932 via the Ubuntu Update Manager. That is looking less likely now, but I could do a reinstall just to make sure.

The Ubuntu Synaptic Manager shows that the latest version of Codeblocks is  (10.05svn7932-1) with details as follows:

PACKAGE                                INSTALLED
codeblocks                               Yes
codeblocks-additional
codeblocks-additional-common-properties 
codeblocks-additional-dbg
codeblocks-common                        Yes
codeblocks-contrib
codeblocks-contrib-common                Yes
codeblocks-contrib-dbg
codeblocks-dbg
codeblocks-dev                           yes
codeblocks-headers                       yes
codeblocks-libwxcontril0                 yes
codeblocks-wxcontrib-dev
codeblocks-wxcontrib-header
libwxsmithlib0                           yes
wxsmith-dev
wxsmith-headers

Q2.  Not all modules are installed, in particular codeblocks-dbg and codelocks-contrib-dbg. Is that correct? Should these and perhaps some other modules also be installed?

Q3.  The synaptic manager provides functions for installing, reinstalling and removing modules. If I first ask it to remove all codeblocks modules shown as installed above, then what packages/modules shall I request for the reinstall?

Ken
 

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: After upgrade to Codeblocks svn 7932 debugging does not work
« Reply #5 on: April 22, 2012, 08:46:50 pm »
Did anybody (just linux users !!) test the patch I posted here ?
It should not break anything, but work if there is no uppercase -T in the call to the terminal.

Please test and report back, whether it works or not.

If there is no answer, I will commit it.

Offline Folco

  • Regular
  • ***
  • Posts: 343
    • Folco's blog (68k lover)
Re: After upgrade to Codeblocks svn 7932 debugging does not work
« Reply #6 on: April 22, 2012, 09:07:33 pm »
I would be happy to test if I could get C::B working :D ( http://forums.codeblocks.org/index.php/topic,16232.0.html )
Kernel Extremist - PedroM power

Offline resander

  • Multiple posting newcomer
  • *
  • Posts: 49
Re: After upgrade to Codeblocks svn 7932 debugging does not work
« Reply #7 on: April 23, 2012, 02:33:51 pm »
Here is a result summary: 

Code: [Select]
xterm -T $TITLE -x:
 Build menu Run or Build&Run:
   no console window
   program runs to completion
 Debug menu Start F8: 
   no console window
 Debug menu Run to cursor F4: 
   no console window
   F4 program stops OK at cursor in source code window
   stepping with F7 and Shift F7 work

xterm -t $TITLE -x:
  same as xterm -T $TITLE -x


gnome-terminal -t $TITLE -x
 Build menu Run or Build&Run:
   console window with title <project name> appears and stays
   program runs to completion
 Debug menu Start F8: 
   no console window
   program runs to completion
 Debug menu Run to cursor F4:
   a blank window with title Program Console appears
   cursor not stopping in source window (no yellow mark in left margin) 
   stepping with F7 does not work

gnome-terminal -T $TITLE -x
 Build menu Run or Build&Run:
   no console window
   program did not run
 Debug menu Start F8: 
   no console window
   program runs to completion
 Debug menu Run to cursor F4:
   no console window
   F4 program stops OK at cursor in source code window
   stepping with F7 or Shift F7 works


The gnome-terminal works in part now.
This is odd, since I observed it not working for svn 7932 before, which made me start this thread. Tried many times then, even with a 10-line console main program as new project. Don't understand why it is working again.

The terminal emulator window does not always appear and that makes program command line IO impossible from codeblocks, i.e command-line programs cannot be tested.

Open Source projects are often designed for the command-line with thin GUI wrappers added afterwards, so command-line programs are still important.

Command line io was working fine before svn 7932. Hopefully it will soon be available again.

Ken

Offline zergling

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: After upgrade to Codeblocks svn 7932 debugging does not work
« Reply #8 on: April 24, 2012, 06:52:13 am »
Hi Guys,
Since I installed the svn 7932 the Debugging Windows Watches stays empty :(

Is this just happening to me? Jens, is your patch going to solve my issue? If so, how do I apply it?

I am running Debian Testing 64 Bit

Bye and thank you very much
« Last Edit: April 24, 2012, 07:50:04 am by zergling »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11939
    • Travis build status
(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 zergling

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: After upgrade to Codeblocks svn 7932 debugging does not work
« Reply #10 on: April 24, 2012, 09:13:59 am »
http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks#In_latest_nightly_builds

"The automatic inclusion of local variables and function arguments have not being reimplemented. Sorry about the inconvenience."
When is going to be implemented?

I do not know if is just me but I found the debugging process more complicated :(

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11939
    • Travis build status
Re: After upgrade to Codeblocks svn 7932 debugging does not work
« Reply #11 on: April 24, 2012, 09:42:10 am »
In fact now it is way easier to use the watches, but you have to get used to it.

For the normal debugger I have no intent to reimplement them, because they are slow and can crash gdb.
For the new gdb/mi debugger plugin only time will tell.
(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 jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: After upgrade to Codeblocks svn 7932 debugging does not work
« Reply #12 on: June 15, 2012, 10:19:06 am »
I just committed the patch I have posted here: http://forums.codeblocks.org/index.php/topic,16207.msg109484.html#msg109484 .
Finding tty that do not use xterm should now (hopefully) always work.