Recent Posts

Pages: [1] 2 3 4 5 6 ... 10
1
Help / Re: Upgrading CB 13.12 to 16.01 failed saving config files.
« Last post by oBFusCATed on Today at 01:14:25 am »
If we can't reproduce a problem then we most probably can't fix it.
And also most of the times such problems are caused by user errors.

The upgrade process doesn't need to run as root. I'm surprised that it did the correct thing to copy the files in /home/bla/.config and not /root/.config/.
If you have the original ~/.codeblocks folder you could try to remove the ~/.config/codeblocks and see if the upgrade code runs fine with your normal user.

p.s. I don't know what you're using to list files, but the listings in the previous post miss the most important information - user/group and permissions. Also please next time use code tags to organise your post better (the list # button).
p.p.s. I guess this is one more reason to never setup a system to support sudo. It is too easy to run commands as root...
2
Using Code::Blocks / Re: Showing vector elements in debugger
« Last post by BlueHazzard on Today at 01:11:43 am »
ok, here is my full working setup:
gcc: TDM-gcc 4.9.2
gdb: http://sourceforge.net/projects/gdbmingw/files/gdb2016-01-30.zip/download

stl script in TDM-GCC-32\share\gcc-4.9.2\python\libstdcxx\v6 printers.py and xmethods.py are attached. I don't remember where i got them from (probably the svn tree)

i use a gdb file in TDM-GCC-32\bin\stl.gdb :
Code: [Select]
python
import sys
sys.path.insert(0, 'TDM-GCC-32\share\gcc-4.9.2\python')
from libstdcxx.v6.printers import register_libstdcxx_printers
#register_libstdcxx_printers (None)
end

and in the debugger settings:
Settings->Debugger->GDB->Default->initialization commands:
Code: [Select]
source TDM-GCC-32\bin\stl.gdb
if i debug this code:
Code: [Select]
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    vector<double> test;
    test.push_back( 22.44 );
    test.push_back( 1.3795933261199322e-306 );

    cout << "Hello world!" << endl;
    return 0;
}

i get this debugger log, and all works fine:
Code: [Select]
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: ****\
Adding source dir: ****\
Adding file: ****\bin\Debug\rerreer.exe
Changing directory to: ****.
Set variable: PATH=#######

[debug]Command-line: TDM-GCC-32\bin\gdb.exe -fullname -quiet -nx -args ****bin/Debug/rerreer.exe
[debug]Working dir : ****

Starting debugger: TDM-GCC-32\bin\gdb.exe -fullname -quiet -nx -args ****bin/Debug/rerreer.exe
done

[debug]> set prompt >>>>>>cb_gdb:
[debug]Skip initializing the scripting!

Setting breakpoints

[debug]Reading symbols from ****bin/Debug/rerreer.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.10.50.20160130-git
[debug]Copyright (C) 2016 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 "mingw32".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[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 (GDB) 7.10.50.20160130-git

[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 200
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source TDM-GCC-32\bin\stl.gdb
[debug]> directory ****
[debug]>>>>>>cb_gdb:
[debug]> break "****main.cpp:12"
[debug]Source directories searched: ****/rerreer;$cdir;$cwd
[debug]>>>>>>cb_gdb:Breakpoint 2 at 0x4013ce: file ****\main.cpp, line 12.

Source directories searched: ****/rerreer;$cdir;$cwd

[debug]> run
[debug]>>>>>>cb_gdb:Starting program: ****\bin\Debug\rerreer.exe
[debug]> info frame

Child process PID: 7276

[debug][New Thread 7276.0x16ec]
[debug]Breakpoint 2, main () at ****\main.cpp:12
[debug]****\main.cpp:12:187:beg:0x4013ce
[debug]>>>>>>cb_gdb:Stack level 0, frame at 0x28ff30:

At ****\main.cpp:12

[debug]> whatis test
[debug] eip = 0x4013ce in main (****\main.cpp:12); saved eip = 0x4010fd
[debug] source language c++.
[debug] Arglist at 0x28ff18, args:
[debug] Locals at 0x28ff18, Previous frame's sp is 0x28ff30
[debug] Saved registers:
[debug]  ebx at 0x28ff0c, ebp at 0x28ff18, esi at 0x28ff10, edi at 0x28ff14, eip at 0x28ff2c
[debug]>>>>>>cb_gdb:type = std::vector<double>
[debug]> output test
[debug]>>>>>>cb_gdb:
[debug]> whatis test[2]
[debug]std::vector of length 2, capacity 2 = {22.440000000000001, 1.3795933261199322e-306}>>>>>>cb_gdb:type = double
[debug]> output test[2]
[debug]>>>>>>cb_gdb:
[debug]> whatis test[0]
[debug]-2.5301706769843864e-098>>>>>>cb_gdb:type = double
[debug]> output test[0]
[debug]>>>>>>cb_gdb:
[debug]> whatis test[1]
[debug]22.440000000000001>>>>>>cb_gdb:type = double
[debug]> output test[1]
[debug]>>>>>>cb_gdb:
[debug]> bt 30
[debug]1.3795933261199322e-306>>>>>>cb_gdb:#0  main () at ****\main.cpp:12
[debug]>>>>>>cb_gdb:

i know this is all frustrating, and as soon as we will find out what goes wrong i will try to create a wiki entry with the exact steps...

[Edit:] NOTE: i have altered all paths, so you have to use absolute paths for all path entries. I also don't use any white spaces or non ASCII characters in my paths

3
Help / Re: Upgrading CB 13.12 to 16.01 failed saving config files.
« Last post by dmarques on Today at 01:04:37 am »
Ok, here are the steps I took and what precisely happened.

1) I've downloaded downloaded CB 16 from Sourceforge, at:

https://sourceforge.net/projects/codeblocks/files/Binaries/16.01/Linux/Ubuntu%20Trusty/

as it was intended to be installed on a Ubuntu 14.04 (64 bit).

2) I've removed all the packages from CB 13.12 that were previously installed and installed all the 16.01 .deb packages that came in the zipped file:

  1827912 Jan 29  2016 codeblocks_16.01_amd64.deb
  3321832 Jan 29  2016 codeblocks-common_16.01_all.deb
  2748132 Jan 29  2016 codeblocks-contrib_16.01_amd64.deb
   620626 Jan 29  2016 codeblocks-contrib-common_16.01_all.deb
 32935998 Jan 29  2016 codeblocks-contrib-dbg_16.01_amd64.deb
 27567312 Jan 29  2016 codeblocks-dbg_16.01_amd64.deb
   408184 Jan 29  2016 codeblocks-dev_16.01_amd64.deb
   721512 Jan 29  2016 codeblocks-headers_16.01_all.deb
   702690 Jan 29  2016 codeblocks-libwxcontrib0_16.01_amd64.deb
   408890 Jan 29  2016 codeblocks-wxcontrib-dev_16.01_amd64.deb
   459098 Jan 29  2016 codeblocks-wxcontrib-headers_16.01_all.deb
  2303746 Jan 29  2016 libcodeblocks0_16.01_amd64.deb
  1096972 Jan 29  2016 libwxsmithlib0_16.01_amd64.deb
   407462 Jan 29  2016 libwxsmithlib0-dev_16.01_amd64.deb
   408160 Jan 29  2016 wxsmith-dev_16.01_amd64.deb
   470924 Jan 29  2016 wxsmith-headers_16.01_all.deb

I had to "dpkg -i --force-all *.deb" as some modules have cross dependencies.

3) Running CB 16 for the first time:

Before the splash screen came up it popped up a dialog saying the config files at "~/.codeblocks" (on CB 13.12) had to be moved to "~/.local/share/codeblock" for better compatibility (I can remember the exact text displayed, sorry). Then everything seemed normal, it asked for a default compiler (as expected) and so on.

Later I noticed that it hadn't saved the default compiler (gcc) because it kept asking for it again and again, every time I started CB.

Just to make sure it wasn't saving anything, I created a mock-up project and noticed (later, on another run) it wasn't showing on the latest projects list.

4) The previous "~/.codeblocks" dir listing was: (owned by my_user:my_user - not root)

   128 Out 30  2015 BrowseTracker.ini
 35553 Jun 21 23:33 cbKeyBinder10.ini
 36004 Out 30  2015 cbKeyBinder10.ini.bak
   198 Jun 21 23:35 codesnippets.ini
 55935 Jun 21 23:35 default.conf
   214 Abr  4 04:00 default.workspace
   253 Jun 21 20:45 default.workspace.layout
   231 Jun 21 23:35 DragScroll.ini
     0 Jun 21 23:35 en_US_personaldictionary.dic
  4096 Dez 13  2014 share

The new "~/.local/share/codeblocks/" dir listing was: (also owned by my_user:my_user)

 4096 Mai 29  2016 plugins
 4096 Mai 29  2016 scripts

Where "plugins" and "scripts" are both empty.

5) Running "codeblocks" from a terminal:

There was a warning message saying it couldn't save the config file (probably default.conf) so I had to "sudo codeblocks", and then it saved config files (after running CB for a second time, no more asking about the default compiler).

After searching for "default.conf" on various locations I've found it at: "~/.config/codeblocks/" (yes, not "/root/.config/codeblocks" but "/home/my_user/.config/codeblocks"), whose dir listing is:

 37549 Jun 22 05:28 cbKeyBinder10.ini
   198 Jun 22 05:28 codesnippets.ini
 38679 Jun 22 05:28 default.conf
   231 Jun 22 05:28 DragScroll.ini
     0 Jun 22 05:28 en_US_personaldictionary.dic

Note: my_user:my_user owns both "~/.config" and "~/.config/codeblocks", but the files above were initially owned by root:root as they were written by CB 16 when I first sudoed it.

6) To make it work properly, I've changed the ownership of those files to my_user:my_user. Now all is normal.

The new config (base) dir "~/.local/share/codeblock" remains unused, as well as "plugins" and "scripts" in it.

I haven't tried to reproduce this a number of times but it seems, at least, unexpected.
4
Enable c++11 or 14, include the proper file where int_max is defined, but first read the rules of the forum, because you're violating them. Reading the FAQ on the wiki is also a good idea.  ;D 8)
5
Help / Question about CodeBlocks supporting INT_MAX and 'auto' types
« Last post by Xanadu4Ever on Today at 12:09:39 am »
I am an older coder and haven't touched C++ in years.  Now, I'm jumping back in and honing my skills.  I love the IDE so far.  I thought I would ask a question about functionality.  (Forgive me if this seems like a noob question dripping with ignorance)

I HOPE this is the place to ask this question and that the question gods don't freak out..... just let me know if this is inappropriate or needs to be in a different place and I will look elsewhere for help....

My question is this==> I noticed when I try to use INT_MAX that I get errors
that it is obviously not declared.  Is this defined in a 3rd party's plug-in and won't work until I install the appropriate plug in?  Or is this a namespace issue?

Also, the IDE doesn't recognize 'auto' types..... again is this a plug in issue or how I have the compiler set up??

Ideas?

Xanadu
6
Using Code::Blocks / Re: Showing vector elements in debugger
« Last post by oBFusCATed on Today at 12:04:21 am »
M$'s comm. ed.
Are you talking about visual studio?

Do you want my opinion about a development chain where nothing fits together, and debugging vector[1] is impossible?
This won't change anything. Patches improve the situation. Ranting is just ranting.

OK, if the python scripts have to match the c++ standard library ... I moved the original scripts (from mingw 4.9.2) back.
Effect: same effect.
Yes, they need to match, because the standard library changes its internals and the python script need to know the internals of the library.

Does gdb has to match too?
Only to the point that the Python APIs used in the scripts are compatible. But I think the gdb's python apis are relatively stable.

@bluehazzard: Does this example work for you?
7
Help / Re: Upgrading CB 13.12 to 16.01 failed saving config files.
« Last post by oBFusCATed on Yesterday at 11:58:12 pm »
If you can reproduce it multiple times then it is probably a bug.
We need exact steps to reproduce the problem.
We need the state of your ~/.codeblocks folder before upgrading and the state of ~/.config/codeblocks after the upgrade.

note: When running as root ~ is /root not /home/yourusername or something similar.
8
Using Code::Blocks / Re: Showing vector elements in debugger
« Last post by nji on Yesterday at 11:34:08 pm »
No, I'm not sure at all if anything matches together. I just downloaded the "updates" as pointed to in http://forums.codeblocks.org/index.php/topic,21998.msg149716.html#msg149716.
Sigh ... do you need any more explanation why M$'s comm. ed. is so popular?
Do you want my opinion about a development chain where nothing fits together, and debugging vector[1] is impossible?
...
OK, if the python scripts have to match the c++ standard library ... I moved the original scripts (from mingw 4.9.2) back.
Effect: same effect.
Does gdb has to match too?
This becomes ridiculous and frustrating.
9
Help / Upgrading CB 13.12 to 16.01 failed saving config files.
« Last post by dmarques on Yesterday at 09:58:59 pm »
After upgrading from CB 13.12 to 16.01, on Ubuntu 14.04, I have found a problem.

During the first CB 16 run, it says the config files (at "~/.codeblocks" on CB 13.12) must be moved to "~/.local/share/codeblock".

However, CB 16.01 never gets to save config files to that new dir.

At first, CB 16 wasn't saving anything so, checking the messages on a terminal, (while quitting) it said it could not save the config file (default.conf I guess).

The ownership of the new config dir ("~/.local/share/codeblock") was just fine, properly set to non root users.

So... Running CB 16 as root, it managed to properly save the config files, but... where?

Those files were actually saved to "~/.config/codeblocks"

After chowning "~/.config/codeblocks" to non-root users, everything is fine.

But, this is a sort of a bug, isn't it?
10
Using Code::Blocks / Re: Showing vector elements in debugger
« Last post by oBFusCATed on Yesterday at 09:20:32 pm »
And "test[1]" is not a too complex expression ...
Why do you think this is not a complex expression?
Are you sure you're python scripts match the version of you c++ standard library you're using?
Pages: [1] 2 3 4 5 6 ... 10