User forums > Help

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

(1/6) > >>

astorga:
I'm having a VERY strange problem with C::B and GDB.

I'm trying to set a breakpoint to a very simple program (just the auto-generated code from project template):


--- Code: ---#include <stdio.h>
#include <stdlib.h>

int main()
{
    printf("Hello world!\n");
    return 0;
}

--- End code ---

I put a breakpoint in "printf" line and start debug, it doesn't stop at breakpoint.

here's the full GDB log:


--- Code: ---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

--- End code ---

Yes, project is with -g flag marked and with "debug" chosen as build target.
Yes, "Use Full Paths for source files (GDB Workaround)" is marked (tried with it unmarked, no difference)

I'm using release 10.05 installed with mingw, Win xp sp3

Last thing that I tried was a uninstall, reboot, install, test... no success.  :(

The most weird thing is that i already succeeded to use GDB before...

Any idea?

zabzonk:
This:

No source file named C:/prjs/wordwrap/main.c in loaded symbols.

is the message you get if you try to debug an executable that doesn't contain debug info. Check in Project|Build Options that you have "Produce debugging symbols" checked, and that you are not trying to debug a release build.

astorga:

--- Quote from: Neil Butterworth on July 18, 2012, 04:39:39 pm ---This:

No source file named C:/prjs/wordwrap/main.c in loaded symbols.

is the message you get if you try to debug an executable that doesn't contain debug info. Check in Project|Build Options that you have "Produce debugging symbols" checked, and that you are not trying to debug a release build.
--- End quote ---


--- Quote ---Yes, project is with -g flag marked and with "debug" chosen as build target.
--- End quote ---
-g = "Produce debugging symbols"
Double-checked this, it is marked... still nothing :(

oBFusCATed:
http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks

There is another magic flag used for stripping the symbols from the executables (-s).

astorga:

--- Quote from: oBFusCATed on July 18, 2012, 04:46:18 pm ---http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks

There is another magic flag used for stripping the symbols from the executables (-s).

--- End quote ---
Checked now, was already unticked...

Navigation

[0] Message Index

[#] Next page

Go to full version