Recent Posts

Pages: 1 2 3 4 5 [6] 7 8 9 10
51
Using Code::Blocks / Re: Help debugging with GDB...
« Last post by oBFusCATed on August 10, 2018, 07:53:50 pm »
1. Make sure you're not stripping symbols.
2. Make sure you're able to debug simple hello world type of application
3. When paused execute the "info shared" command and see if all modules have symbols.
52
Using Code::Blocks / Help debugging with GDB...
« Last post by PaulR on August 10, 2018, 06:07:39 pm »
Hi

I am building an existing C + C++ project via shell scripts in MSYS2 and attempting to debug using Code::Blocks (svn 11313).
  • Code::Blocks is successfully executing the resultant exe (which works along with several .dlls, all built with a debug config).
  • GDB is successfully attaching to the process. There are no warnings about symbols not being found and I am able to pause and continue execution.
However, when I pause and continue I get the following message:
Code: [Select]
Trying to interrupt process with pid: 1488; child pid: 1488 gdb pid: 6664
In ?? () ()
Continuing...

... and the call stack is empty too with ?? 0 as the current function.

In the C::B project I have added all header and source files from the exe source and the dll sources. I have added the Qt include path to the "Additional debugger search directories" too, since it uses that.

Could somebody please explain the schoolboy error I am making here?

Thanks in advance for any assistance.
53
Hello BlueHazzard,
It's about C++ files not C files.
I want to create a cbp file for each directory and sub directory.





choisir_les_constructeurs.cbp
Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="choisir_les_constructeurs" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/choisir_les_constructeurs" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="bin/Release/choisir_les_constructeurs" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
<Add option="-fexceptions" />
</Compiler>
<Unit filename="main.cpp" />
<Extensions>
<code_completion />
<envvars />
<debugger />
<lib_finder disable_auto="1" />
</Extensions>
</Project>
</CodeBlocks_project_file>

finale.cbp
Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="finale" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/finale" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="bin/Release/finale" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
<Add option="-fexceptions" />
</Compiler>
<Unit filename="main.cpp" />
<Extensions>
<code_completion />
<envvars />
<debugger />
<lib_finder disable_auto="1" />
</Extensions>
</Project>
</CodeBlocks_project_file>




54
Using Code::Blocks / Re: How to tell Code::Blocks where wxWidgets is?
« Last post by stahta01 on August 10, 2018, 04:37:08 pm »
Code: [Select]
'wx-config --cxxflags'
And, why did you not change these to back ticks?

Tim S.
55
Using Code::Blocks / Re: How to tell Code::Blocks where wxWidgets is?
« Last post by spflanze on August 10, 2018, 03:36:56 pm »
The build log:
Code: [Select]
-------------- Clean: Debug in TIA Designer (compiler: GNU GCC Compiler)---------------

Cleaned "TIA Designer - Debug"

-------------- Build: Debug in TIA Designer (compiler: GNU GCC Compiler)---------------

g++ -Wall -I/usr/local/lib/wx/include/gtk2-unicode-static-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -pthread 'wx-config --cxxflags' -g -g -I../Libraries/cminpack-1.3.6 -Iinclude -c "/home/me/Engineering Software/Libraries/cminpack-1.3.6/cpp/dpmpar.cpp" -o obj/Debug/Libraries/cminpack-1.3.6/cpp/dpmpar.o
g++: error: wx-config: No such file or directory
g++: fatal error: no input files
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))
56
I've been messing with this for hours, and I can't seem to figure out how to configure Code::Blocks to do what I want it to. Please don't confuse my lack of going over everything I have tried as not trying; I've just tried too many things at this point to remember them all! :-) Instead, I will just list what I ended up with.

My specific situation: My application (a daemon) has a launcher script that serves as watchdog and some other functions, some of them rather messy on the filesystem. Some of the features also involve the application being restarted. Because of existing features and compatibility with the production environment, there is an existing Makefile.

My goals:

1. Use my existing Makefile.

Complete: I was able to accomplish this.

2. When I click Run/Debug, I want the launcher script to be launched, not my executable.

Complete-ish: I worked around the problem using the first method listed in https://stackoverflow.com/questions/22059855/configure-launch-command-in-codeblocks, which relies on an extra virtual target. The fact I need to confirm my target to run each time is kind of annoying, but it is better than nothing. I would love to get rid of that dialog each time, though.

3. Have GDB automatically attach to child processes spawned by my launcher script.

Almost zero progress here. I configured gdb's initialization command to go 'set follow-fork-mode child', but unfortunately I am not getting anywhere; a segmentation fault during process start is not picked up on.


My current results when trying to 'Start / Continue' (F8, red arrow) look as follows:

Code: [Select]
Active debugger config: GDB/CDB debugger:Myproject
Building to ensure sources are up-to-date
Selecting target:
startup
Adding source dir: /home/worstje/myproject/
Adding source dir: /home/worstje/myproject/
Adding file: /home/worstje/myproject/src/startup
Changing directory to: /home/worstje/myproject/src
Set variable: LD_LIBRARY_PATH=.:
Starting debugger: /usr/bin/gdb -fullname -quiet  -args /home/worstje/myproject/src/startup
done
Setting breakpoints
Debugger name and version: GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Continuing...
Starting the debuggee failed: No executable file specified.
Debugger finished with status 0

Note that it freezes with a blank xterm screen after the 'Setting breakpoints', at which point I tell it to continue. (I guess it is trying to debug the shell script?) Unfortunately, it doesn't pickup anything afterwards, and then completely stops with the message you see below.

Using plain 'Run' (Ctrl+F10, green arrow) has the shell script executing normally, but when it launches my binary it has its segmentation fault.


I hope this information is enough to let you experts direct me to exactly what I need to do to try and make this work.

Thank you for your time and assistance. :-)
57
Plugins development / Re: [SOLVED] How to clear strings from wxListBox
« Last post by BlueHazzard on August 10, 2018, 01:52:43 pm »
Quote
Although Clear() isn't listed for me when I Ctrl + Spacebar, I manually put it in (expecting an error to be thrown) and it worked. I can't help but wonder why Clear() doesn't show next to ListBox1-> when I use Ctrl + Spacebar. Crazy, that!
Don't use code completion for code reference or documentation... Function names do not describe always what a function does... Read the documentation of the code to be sure. Our cc parser is not the best with templates and the new wxWidgets uses template code for containers so this is probably the reason why the completion does not work for container functions...
58
Using Code::Blocks / Re: Turn off the extra quote/brace when I type quote/brace
« Last post by BlueHazzard on August 10, 2018, 01:48:50 pm »
You have to press "save-all" for codeblocks to save the settings. Only hitting "OK" is not enough.... Or you need a clean close of codeblocks so it will save it automatically...
59
Help / Re: C::B needs much time to run program
« Last post by BlueHazzard on August 10, 2018, 01:47:12 pm »
Do you have some anti virus running? They slow down compiling, execution a lot, because compiler are basically viruses....
60
Using Code::Blocks / Re: How to tell Code::Blocks where wxWidgets is?
« Last post by BlueHazzard on August 10, 2018, 01:45:51 pm »
Quote
In the included cbp file I changed the apostrophe back to the back tick.
not everywhere:
Code: [Select]
<Target title="Debug">
<Option output="bin/Debug/TIA Designer" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="0" />
<Option compiler="gcc" />
<Option projectLinkerOptionsRelation="2" />
<Compiler>
<Add option="&apos;wx-config --cxxflags&apos;" />
<Add option="-g" />
</Compiler>
<Linker>
<Add option="`wx-config --libs`" />
</Linker>
</Target>
Pages: 1 2 3 4 5 [6] 7 8 9 10