User forums > Using Code::Blocks

Don't understand debugging..???

<< < (7/8) > >>

Biplab:

--- Quote from: jens on October 28, 2007, 01:30:53 pm ---If you select "Release" here, but in the toolbar there is "Debug" selected, codeblocks builds the Debug-version, but the debugger tries to debug the Release-version.
For me this goes away by either select "Release" and then reselect "Debug", as you wrote, or close and reopen codeblocks.

I'm not sure why the debugger sometimes thinks the project has no valid target. It happens when I open the codeblocks project-file (where no Debug and Release targets are included), switch between files and jump to a declaration, then close the project with "File -> Close all projects" and then open my test-project.
I think the active target should be taken from the taskbar, because this is the one taken from the projects layout-file, and when the target is changed in the debugger plugin, by selecting a target it would be more consistent if the taskbar also changes.

--- End quote ---

They are part of two different plugins. Toolbar for target selection belongs to Compiler plugin. But they should interact well with each other. :)


--- Quote from: jens on October 28, 2007, 01:30:53 pm ---By the way is it possible to debug codeblocks from within codeblocks, or do I need an external-debugger(-gui).
It works with "kdbg" but it's not as comfortable as C::B. I also tried "insight" but ...  :(

--- End quote ---

You can debug C::B inside C::B (we do this).


--- Quote from: jens on October 28, 2007, 04:23:23 am ---I did a little debugging this night.
There another little bug in degbugging: when you start debugging with 'Step-Into' gdb breaks at start of main as it should, but the cursor did not change.

I created a patch that fix this bug and the problem, that gdb does not stop at first breakpoint if it's the first instruction in "main", or exactly it stops, queues "info program" and continues.

Another problem still is there: if code gets automatically rebuild "Step-Into" does not stop at beginning of "main" if no breakpoint is set.

--- End quote ---

Thanks a lot for the investigation and the patch. Please post them in Berlios so that they don't get lost. :)

Jenna:

--- Quote from: Biplab on October 28, 2007, 02:10:06 pm ---You can debug C::B inside C::B (we do this).

--- End quote ---

I thought so, but I'm not able to make it work.
I always get a message like this
--- Code: ---Cannot find resources...
Code::Blocks was configured to be installed in '/usr/src/c/codeblocks/codeblocks-1.0svn.patch/src/devel/share/codeblocks'.
Please use the command-line switch '--prefix' or set the CODEBLOCKS_DATA_DIR environment variable to point where Code::Blocks is installed,
or try re-installing the application...
--- End code ---

I tried several prefixes, but none of them seems to work.

If I debug with kdbg I use a debug build made with "--configure ...", "make" and "make install" that works, but to change some code and try it is always a long way, because I have to leave kdbg first and recompile codeblocks and ...

johne53:

--- Quote from: Biplab on October 28, 2007, 02:10:06 pm ---They are part of two different plugins. Toolbar for target selection belongs to Compiler plugin. But they should interact well with each other. :)
--- End quote ---

So hopefully there might be a simple fix for this? It looks like the debugger is failing to take account of the currently selected Build Target when the debugging process gets initiated.... At least there's a simple workaround but it would be nice if this could be fixed. Do I need to report it as a bug?


--- Quote from: jens on October 28, 2007, 01:30:53 pm ---if I open C::B and then close it without doing anything (no project is opened) no message-box appears, but two things are changed in "default.conf".
The first is the "Tip of the Day" of course, I think that's okay, but should not trigger the save confirmation message-box, but silently save default.conf if nothing other has changed, even when switching between layouts (mabe it does).
--- End quote ---

I'll try disabling Tip of the Day and see if my spurious message boxes disappear. Thanks.  8)


[Edit...] Well sadly, the answer is 'No' - disabling Tip of the Day doesn't get rid of the dialog boxes. However, there's an option to 'Stop pestering me' which does eliminate them (maybe you've already selected that option, Jens).

Incidentally - even when C::B correctly starts the debugger (i.e. with my Debug version) the working directory, reported in the debugger output window, is still the working directory from the Release target - when it should presumably be from the Debug target. Even if I manually change the execution's working directory (in my project's Debug properties) the debugger still reports the wrong working directory. Is this something that might as well get fixed at the same time?

Jenna:

--- Quote from: Biplab on October 28, 2007, 02:10:06 pm ---Thanks a lot for the investigation and the patch. Please post them in Berlios so that they don't get lost. :)

--- End quote ---

I tried to register at berlios today, but they did not send the activation email. There is an option to resend mail, but this also does not work. Sometimes they say mail is sent, sometimes theres an error message about being unable to connect to database.

I will not be at home the next week until thursday or friday, without internet as I wrote, so I can't post the patch in Berlios before next weekend ( if the berlios system feels better until then  :) ).



--- Quote from: johne53 on October 28, 2007, 04:04:27 pm ---[Edit...] Well sadly, the answer is 'No' - disabling Tip of the Day doesn't get rid of the dialog boxes. However, there's an option to 'Stop pestering me' which does eliminate them (maybe you've already selected that option, Jens).

--- End quote ---

No I did not disable it, I like to be asked whether the files should be saved or not.

kylemallory:
I'm having a similar type debugging experience, but not identical.

I am trying to debug a shared library in an external application.  I've just barely installed Code::Blocks for the first time, so its entirely likely that my issue is simply noob-related.

When the debugger starts, I get "(no debugging symbols found)".  Looking at the debug log, it looks like its doing everything correctly... just no debug info.

I've double checked my project and build settings to make sure debug (-g) info is turned on, and that I'm not striping symbol data from the binaries, but still no go.

Below is the debugger log.

Is there anyway to get similar type log from gcc and ld?  to know exactly what command-line options they are being sent?


--- Code: ---LD_LIBRARY_PATH=.:
Command-line: /usr/bin/gdb -nx -fullname  -quiet -args /home/kmallory/ifx/bin/piranha
Working dir : /home/kmallory/workspace/AVCodec/
> set prompt >>>>>>cb_gdb:
(no debugging symbols found)
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb 6.6-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
>>>>>>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 disassembly-flavor intel
>>>>>>cb_gdb:
> directory /home/kmallory/workspace/AVCodec/bin/debug
>>>>>>cb_gdb:
> directory /home/kmallory/workspace/AVCodec/
>>>>>>cb_gdb:
> set args -w -m bin/debug/avcodec.so
>>>>>>cb_gdb:
> break "/home/kmallory/workspace/AVCodec/avcodec.c:539"
No symbol table is loaded.  Use the "file" command.
>>>>>>cb_gdb:
> break "/home/kmallory/workspace/AVCodec/avcodec.c:592"
No symbol table is loaded.  Use the "file" command.
>>>>>>cb_gdb:
> break "/home/kmallory/workspace/AVCodec/avcodec.c:556"
No symbol table is loaded.  Use the "file" command.
>>>>>>cb_gdb:
> break "/home/kmallory/workspace/AVCodec/avcodec.c:567"
No symbol table is loaded.  Use the "file" command.
>>>>>>cb_gdb:
> start
Breakpoint 1 at 0x82ba932
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1226144032 (LWP 8380)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Switching to Thread -1226144032 (LWP 8380)]
0x082ba932 in main ()
>>>>>>cb_gdb:
> bt 30
#0  0x082ba932 in main ()
>>>>>>cb_gdb:
> whatis n
No symbol table is loaded.  Use the "file" command.
>>>>>>cb_gdb:
> output n
No symbol table is loaded.  Use the "file" command.
>>>>>>cb_gdb:
> output n
No symbol table is loaded.  Use the "file" command.
>>>>>>cb_gdb:
> output n
No symbol table is loaded.  Use the "file" command.
>>>>>>cb_gdb:
> tbreak "/home/kmallory/workspace/AVCodec/avcodec.c:538"
No symbol table is loaded.  Use the "file" command.
>>>>>>cb_gdb:
> cont
Support Directory is /home/kmallory/ifx/piranha
(no debugging symbols found)
(no debugging symbols found)
Unable to open wacom tablet (stylus)
Kiari Version 1.2.2 - Copyright 2006 Interactive Effects
HardwareFX Version 1.0.0-r7
File /home/kmallory/.piranha/piranha/prefs//deck_jericho not available
SPFX: error reading file ./bin/debug/avcodec.so
Error loading module ./bin/debug/avcodec.so: undefined symbol: av_openread
This license will expire in 1 day.
The hostid for this workstation is 00:15:c5:4f:73:43
Unknown format of the requested file /media/VIDEO VAULT/DRTN Color Pass/DeathR06V01.430158D8.E68790.omf.avi
Unknown format of the requested file /media/VIDEO VAULT/DRTN Color Pass/DeathR06V01.4301582A.BC2120.omf.avi
Unknown format of the requested file /media/VIDEO VAULT/DRTN Color Pass/DeathR06V01.430157F4.AF05B0.omf.avi
Unknown format of the requested file /media/VIDEO VAULT/OMFI MediaFiles/white1127436552V043335108.omf
Piranha Autosave: Unable to write Desktop.autosave
Unknown format of the requested file /media/VIDEO VAULT/OMFI MediaFiles/DeathR03A02.430139C2.4F98F0.aif
This program requires a configured network card
Program exited with code 0377.
>>>>>>cb_gdb:
> quit

--- End code ---

Thanks,

Kyle

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version