Recent Posts

Pages: 1 2 3 4 [5] 6 7 8 9 10
41
Using Code::Blocks / Re: Showing vector elements in debugger
« Last post by nji on June 23, 2017, 10:21:56 am »
In the link you provided in http://forums.codeblocks.org/index.php/topic,21998.msg149716.html#msg149716
it was not necessary to install python?
As the the missing file is included in there...
But ... as it seems ... that way didn't work ... at least at me.
What I mean: If one installs c:b ... is it necessary to install python before, if gdb is python-enabled?
(To my experience it's best to install as few as possible)
Questions over questions ...  :-\
42
Using Code::Blocks / Re: Showing vector elements in debugger
« Last post by BlueHazzard on June 23, 2017, 10:15:35 am »
from ollydbg in http://forums.codeblocks.org/index.php/topic,11301.0.html
Quote
You must install Python 2.7.5 release 32bit version on your system, as my build was linked to this python release.

so you need to install python 2.7.5
I probably had installed it previously...
43
Using Code::Blocks / Re: Showing vector elements in debugger
« Last post by nji on June 23, 2017, 10:11:41 am »
Yes, I do agree!  :)

So I took my clean c:b 16.01 (with mingw 4.9.2) and retraced your steps.

First try I left the two original files __init__.py (empty) and printers.py.
As I don't have any stl.gdb file anywhere, I inserted the init code as
"Debugger initialization commands"

Code: [Select]
python
import sys
sys.path.insert(0, 'C:\Program Files (x86)\CodeBlocks\MinGW\share\gcc-4.9.2\python/libstdcxx/v6')
from printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
end

Also "Enable watch script" disabled.

When I try to debug your code it doesn't work:
Message (translated from German by me):

Code: [Select]
"gdb.exe - systemerror.
The program cannot be startet, as python27.dll is missing on your computer."

And indeed, I searched for the file: it is nowhere.
Looks like you have done some extra steps ... ?
(I checked: When I change back to original gdb debugger works fine again.
Without pretty printing of course)
44
Using Code::Blocks / Re: Showing vector elements in debugger
« Last post by ollydbg on June 23, 2017, 09:40:49 am »
@BlueHazzard, good job and good tutorial. :)
45
Help / Re: Question about CodeBlocks supporting INT_MAX and 'auto' types
« Last post by Xanadu4Ever on June 23, 2017, 04:33:33 am »
Thanks Obfuscated.  I will read the rules for the forum again.  Thanks for the heads up.  I will go to the Wiki and look at the FAQ as you suggest and try to find info on c++11/ 14.

Much obliged and I will try not to violate the forum rules.

Xanadu
46
Help / Re: Upgrading CB 13.12 to 16.01 failed saving config files.
« Last post by oBFusCATed on June 23, 2017, 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...
47
Using Code::Blocks / Re: Showing vector elements in debugger
« Last post by BlueHazzard on June 23, 2017, 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

from ollydbg in http://forums.codeblocks.org/index.php/topic,11301.0.html
Quote
You must install Python 2.7.5 release 32bit version on your system, as my build was linked to this python release.
you need to install python 2.7.5: https://www.python.org/download/releases/2.7.5/

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

[Edit:] add python download link

48
Help / Re: Upgrading CB 13.12 to 16.01 failed saving config files.
« Last post by dmarques on June 23, 2017, 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.
49
Help / Re: Question about CodeBlocks supporting INT_MAX and 'auto' types
« Last post by oBFusCATed on June 23, 2017, 12:33:55 am »
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)
50
Help / Question about CodeBlocks supporting INT_MAX and 'auto' types
« Last post by Xanadu4Ever on June 23, 2017, 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
Pages: 1 2 3 4 [5] 6 7 8 9 10