News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

The 27 October 2014 build (10016) is out.

Started by killerbot, October 28, 2014, 01:16:20 PM

Previous topic - Next topic

oBFusCATed

Khram: Please try to describe the problem with more details, so we can try to solve it. Steps to reprocude, OS? Does it happen with the previous nightly?
(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!]

ollydbg

Quote from: oBFusCATed on November 15, 2014, 01:04:25 PM
Quote from: ollydbg on November 02, 2014, 03:04:17 PM
Debugged a while, I found the reason why this bug happens, but I don't have a clean way to fix this issue.
See, the CC setting was stored in configure file.
When C::B start up, CC will create a default parser object called "temp parser".
When a parser object is created, it will copy the settings(such as the "Case sensitive matches") from the configure file to its own member variable.
When you open the CC dialog, the active parser object's setting will be modified also the CC related setting in configure files will get updated. This means, the configure file contains the active parser's settings.

When a CB project loaded, a new parser object(we call "new parser" here) is created and activated. So far, so good. When you changed the CC setting, both the "new parser"'s setting and the configure file get updated.

The issue comes when you close C::B, which means, you need to
1, destroy "new parser"
2, destroy "temp parser"

When destroy "new parser", all its setting was saved, but after that, the active parser switches to "temp parser", the setting in "temp parser" was active, and finally the "temp parser" get destroyed, its setting was saved (not the "new parser"), so your setting was lost!

I have not a good idea to fix this issue. Say, we have a setting shared by several parser objects. But they may be different, but the last destroyed parser's setting will be saved to the configure file.
Any plans to fix this issue? If not please say so, so I can take a look at it ...  it is quite annoying...
I know it's annoying. As a workaround, you can just open C::B (without any project opened), and open the setting dialog for CodeCompletion, then close C::B, all the settings should be saved.

If you do want to forbid the setting saving of the "temp parser", you can just add an parameter of the Parser's constructor, say

Parser::Parser(....., bool saveSetting = true)
{
...
}


And create a temp parser in the code
m_TempParser = new Parser(this, nullptr, false); // the last parameter means we don't want to save the setting of this temp parser

But note that this still break something, such as the workaround I said before.
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.

Manolo

Hi
Something has gone wrong in my CB svn 10032 (Ubuntu 14.04 64bits) with the watches window:
'tmpv' is a double and it'a shown OK.
'float3' is defined in the previous line to the breakpoint as float float3[3] = {0, -1.5, 8.3};
As you can see every value != 0 is splitted into two lines: the integer and the decimal parts.

Would this issue be related to localization? (I'm at Spain) It does not happen in Windows 8.1

THX

oBFusCATed

Manolo: Can you post the full log from the debugger?
(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!]

Manolo

I have created a new console project with this code:
#include <iostream>

using namespace std;

int main()
{
    float float3[3] = {0, -1.5, 8.3};
    cout << "Hello world!" << endl;
    return float3[0] ? 0 : 1;
}

Put a breakpoint at "cout <<..." line. The behaviour for the watches window is still broken.

Here is the full debugger log:
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: /home/manolo/PROGS/ConsoleMinimal/
Adding source dir: /home/manolo/PROGS/ConsoleMinimal/
Adding file: /home/manolo/PROGS/ConsoleMinimal/bin/Debug/ConsoleMinimal
Changing directory to: /home/manolo/PROGS/ConsoleMinimal/.
Set variable: LD_LIBRARY_PATH=.:/usr/lib32

[debug]Command-line: /usr/bin/gdb -nx -fullname -quiet  -args /home/manolo/PROGS/ConsoleMinimal/bin/Debug/ConsoleMinimal
[debug]Working dir : /home/manolo/PROGS/ConsoleMinimal

Starting debugger: /usr/bin/gdb -nx -fullname -quiet  -args /home/manolo/PROGS/ConsoleMinimal/bin/Debug/ConsoleMinimal
done

[debug]Leyendo símbolos desde /home/manolo/PROGS/ConsoleMinimal/bin/Debug/ConsoleMinimal...
[debug]hecho.
[debug](gdb)
[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

[debug]>>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
[debug]Copyright (C) 2014 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "x86_64-linux-gnu".
[debug]Type "show configuration" for configuration details.
[debug]Para las instrucciones de informe de errores, vea:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]<http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor intel
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Punto de captura 1 (lanzar)
[debug]>>>>>>cb_gdb:
[debug]> source /usr/share/codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory /home/manolo/PROGS/ConsoleMinimal/
[debug]Source directories searched: /home/manolo/PROGS/ConsoleMinimal:$cdir:$cwd
[debug]>>>>>>cb_gdb:
[debug]> break "/home/manolo/PROGS/ConsoleMinimal/main.cpp:8"
[debug]Punto de interrupción 2 at 0x400880: file /home/manolo/PROGS/ConsoleMinimal/main.cpp, line 8.
[debug]>>>>>>cb_gdb:

Punto de interrupción 2 at 0x400880: file /home/manolo/PROGS/ConsoleMinimal/main.cpp, line 8.

[debug]Using terminal's PID as console PID 13970, TTY /dev/pts/11
[debug]> tty /dev/pts/11
[debug]Queued:[tty /dev/pts/11]
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: /home/manolo/PROGS/ConsoleMinimal/bin/Debug/ConsoleMinimal
[debug]Breakpoint 2, main () at /home/manolo/PROGS/ConsoleMinimal/main.cpp:8
[debug]/home/manolo/PROGS/ConsoleMinimal/main.cpp:8:94:beg:0x400880
[debug]>>>>>>cb_gdb:

At /home/manolo/PROGS/ConsoleMinimal/main.cpp:8

oBFusCATed

Hm, does this happen you start C::B from console like LC_ALL=C codeblocks?
C::B parses the output of the debugger, so a localized gdb is expected to break pretty badly.
(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!]

Manolo

Starting C:B from a terminal with command "LC_ALL=C codeblocks" does not show the issue.
So, it seems it's a gdb localized problem.

I haven't changed anything, just used gdb as it is right after installing it.
Should I change it or would C:B be aware of it?

THX

oBFusCATed

@Jens: Any idea how do we solve this same problem for the compiler? I've tried to search for locale setting code, but I couldn't find any.
(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!]

Jenna

For the compiler I added LC_ALL with the value C to "Settings -> Environment... -> Environment variables".
This might (hopefully) also work for gdb.

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!]

Manolo

QuoteFor the compiler I added LC_ALL with the value C to "Settings -> Environment... -> Environment variables".
This might (hopefully) also work for gdb.
Doing this manually works for me.
Thank you for showing this easy solution.

ca1e

Quote from: scarphin on November 04, 2014, 04:20:14 PM
My keyboard shortcuts for 'debugging windows' (namely 'alt-shift-x' where x is a digit between 0 and 9) doesn't work after I load a project. Although they are unchanged in the 'cbKeyBinder10.ini', they are not listed in settings->editor->keyboard shortcuts-> corresponding entries nor do they work. Even when I load a modified codeblocks.cbp project file, 'cbKeyBinder10.ini' changes with all the targets added to the file and 'debugging windows' shortcuts gone. I attached a zip containing 2 'cbkeybinder10.ini' files, one before any project loaded and one after codeblocks.cbp loaded. Also what is the .bak file used for?

Btw is there a way to prevent editor from editing while debugging? I often find myself trying to edit the code during a debugging session which is very frustrating. ;)

Win7 x64 SP1

fyi..
5 years later this bug persists.

i see one other post on the forum about this bug, from this same user.

is there a fix?

oBFusCATed

ca1e: The quote contains two requests. Which one is bothering you?
(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!]

Pecan

#58
@ca1e: cbKeyBinder10.ini is not used by any current nightly. cbKeyBinder10.ini is only referenced to save previous versions of CB key bindings when needed.

Also, I cannot reproduce the described problem. I have no problem using Alt-Shift-0 thru 9. They work for me.
They also display correctly. See attached image.

ca1e

#59
i set hotkeys for debugging windows (memory view, registers) so i can toggle these windows on/off when debugging
after closing a workspace and re-opening it, the keys are erased

it would appear only debugging windows hotkeys are affected