News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

GDB problem (yes, i've used the search)

Started by astorga, July 18, 2012, 04:20:30 PM

Previous topic - Next topic

astorga

Open C::B;
In start page, I clicked "Create a new project";
I choose "Console Application", clicked "Go";
In wizard:
I clicked "next";
selected "C", clicked "next";
in "Folder to create project in:" field, I put "C:\", in Project title, I put "crash_test" (the project folder don't exist yet), clicked "Next";
clicked "Next" again;

Project created.

Then I clicked the gear icon to build the executable. When it finish building the program, I set a breakpoint on line 6 of main.c "printf("Hello world!\n");", clicked "Debug" menu, and then "Start".

The program runs until it ends, the breakpoint is ignored.

MortenMacFly

Quote from: astorga on July 23, 2012, 05:52:38 PM
Open C::B;
[...]
Well if I do it exactly the way you described it works fine here. ???

However - what you didn't tell: Did a full re-build solve your problem?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

astorga

Neither "rebuild" nor "clean and build" works. Same result.  :-\

Kesitem

Hello,

I just have the same problem.
After set my project on a new computer, Code::Blocks was not stopping on break point.
The problem was my project path have an accent.

What is your project path? Is there any space or accent?

Hope it can help!

(Sorry for my bad english)

ollydbg

Quote from: Kesitem on August 17, 2012, 09:04:57 AM
The problem was my project path have an accent.
This may cause the gdb problem, so avoid using space or other non-alphabetic chars in the path.

Quote from: astorga on July 24, 2012, 02:24:46 PM
Neither "rebuild" nor "clean and build" works. Same result.  :-\
Please give us (post) the full debug log here.
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.

astorga

Quote from: ollydbg on August 17, 2012, 09:21:18 AM
Please give us (post) the full debug log here.
It's in the first post:
Quote from: astorga on July 18, 2012, 04:20:30 PM
here's the full GDB log:

PATH=.;C:\Program Files\CodeBlocks\MinGW\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Efl\bin;C:\Program Files\doxygen\bin;C:\Program Files\GtkSharp\2.12\bin;C:\PROGRA~1\PICC;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin;C:\Dev-Cpp\bin
Command-line: C:\Program Files\CodeBlocks\MinGW\bin\gdb.exe -nx -fullname  -quiet -args bin/Debug/wordwrap.exe
Working dir : C:\prjs\wordwrap\
> set prompt >>>>>>cb_gdb:
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-mingw32".
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set debugevents on
>>>>>>cb_gdb:
> set new-console on
>>>>>>cb_gdb:
> set disassembly-flavor att
>>>>>>cb_gdb:
> catch throw
Function "__cxa_throw" not defined in loaded symbols.
>>>>>>cb_gdb:
> source C:\Program Files\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> directory C:/prjs/wordwrap/
>>>>>>cb_gdb:
> break "C:/prjs/wordwrap/main.c:6"
No source file named C:/prjs/wordwrap/main.c in loaded symbols.
Breakpoint 1 ("C:/prjs/wordwrap/main.c:6) pending.
>>>>>>cb_gdb:
> run
gdb: win32_init_thread_list
[New thread 2268.0x450]
Program exited normally.
>>>>>>cb_gdb:
> set debugevents off
>>>>>>cb_gdb:
> quit


ollydbg

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.

astorga

Quote from: ollydbg on August 18, 2012, 05:22:55 PM
Quote from: astorga on August 17, 2012, 07:18:13 PM
Quote from: ollydbg on August 17, 2012, 09:21:18 AM
Please give us (post) the full debug log here.
It's in the first post:
Can you show me the whole "full build log", see:
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Already posted too:
Quote from: astorga on July 18, 2012, 04:57:21 PM
Quote from: oBFusCATed on July 18, 2012, 04:51:52 PM
Have you checked this in you full build log?

See here how to enable it: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

here's the full build log:
-------------- Build: Debug in wordwrap ---------------

mingw32-gcc.exe  -IC:/prjs/wordwrap -c main.c -o obj/Debug/main.o
mingw32-g++.exe  -o bin/Debug/wordwrap.exe obj/Debug/main.o   
Output size is 24,54 KB
Process terminated with status 0 (0 minutes, 7 seconds)
0 errors, 0 warnings



Should the flag appear here? Why is it not appearing?

ollydbg

Quotemingw32-gcc.exe  -IC:/prjs/wordwrap -c main.c -o obj/Debug/main.o
This log message is wrong, it should have -g option. So, you need to adjust the build options. Or, you can create a simple "hello world" project from the project wizard and test again.
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.

astorga

Quote from: ollydbg on August 19, 2012, 10:09:19 AM
Quotemingw32-gcc.exe  -IC:/prjs/wordwrap -c main.c -o obj/Debug/main.o
This log message is wrong, it should have -g option. So, you need to adjust the build options. Or, you can create a simple "hello world" project from the project wizard and test again.
Did you read the entire topic? All the things you asked are already posted (including this step) o.o

ollydbg

I can't find ways to help you because you are the only guy who has such strange issue. :)
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.