Author Topic: Debugger Problem with CB 10.05  (Read 8630 times)

Offline kartari

  • Multiple posting newcomer
  • *
  • Posts: 10
Debugger Problem with CB 10.05
« on: August 03, 2010, 05:07:44 am »
Forgive me for not checking with the bug list at http://developer.berlios.de/bugs/?func=addbug&group_id=5358, but a) I have no account with BerliOS, b) I am not a CB developer and this BerliOS site, I guess, is for CB developers (and other registered project developers, I presume) and c) I am not sure why I need to become a member just to search for open and closed bugs?

Anyway, I just started using CB 10.05 (upgraded from 8.02) and I found strange debugger behavior.  I believe it's a bug.  Basically, no matter how I edit a certain c++ file, the debugger traces through the code line for line as if I never edited it (e.g. via the Next Line tracing command).  In other words, it's as if the file was never altered, and it just keeps debugging the old file over and over again, even though the file has clearly been altered.  Where there was once a function call on line 58 for example, now there is commented code... but the debugger's yellow line highlighter goes to that line nonetheless and actually seems to perform the function call (it deletes a struct pointer).

I know nothing about how the innards of the compiler or debugger work.  I just know how to program c and c++.  I would guess that CB maintains a duplicate copy of the code in one of its files, and is not updating it, perhaps?  Whatever the case may be, is this a known problem, and can it be resolved at present?

Thank you very much.  Again, sorry for not checking with the official bug list, I would cooperate but I just find it strange that I need to register as a developer for a third party site just to view the open and closed bugs and check for solutions.

Btw, I did uninstall 8.02 before installing 10.05 (I installed it over 8.02 first, but had problems loading CB so I uninstalled both and installed 10.05 and it loads fine now).  I'm running in Windows XP Pro SP3 32 bit with 4 (3.2) GB main memory and plenty of hard disk space.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Debugger Problem with CB 10.05
« Reply #1 on: August 03, 2010, 06:56:50 am »
Forgive me for not checking with the bug list at http://developer.berlios.de/bugs/?func=addbug&group_id=5358, but a) I have no account with BerliOS, b) I am not a CB developer and this BerliOS site, I guess, is for CB developers (and other registered project developers, I presume) and c) I am not sure why I need to become a member just to search for open and closed bugs?

Anyway, I just started using CB 10.05 (upgraded from 8.02) and I found strange debugger behavior.  I believe it's a bug.  Basically, no matter how I edit a certain c++ file, the debugger traces through the code line for line as if I never edited it (e.g. via the Next Line tracing command).  In other words, it's as if the file was never altered, and it just keeps debugging the old file over and over again, even though the file has clearly been altered.  Where there was once a function call on line 58 for example, now there is commented code... but the debugger's yellow line highlighter goes to that line nonetheless and actually seems to perform the function call (it deletes a struct pointer).

I know nothing about how the innards of the compiler or debugger work.  I just know how to program c and c++.  I would guess that CB maintains a duplicate copy of the code in one of its files, and is not updating it, perhaps?  Whatever the case may be, is this a known problem, and can it be resolved at present?

Thank you very much.  Again, sorry for not checking with the official bug list, I would cooperate but I just find it strange that I need to register as a developer for a third party site just to view the open and closed bugs and check for solutions.

Btw, I did uninstall 8.02 before installing 10.05 (I installed it over 8.02 first, but had problems loading CB so I uninstalled both and installed 10.05 and it loads fine now).  I'm running in Windows XP Pro SP3 32 bit with 4 (3.2) GB main memory and plenty of hard disk space.
Did you compile the code before debugging???
Did you edit code while debugging???
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.

Offline kartari

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Debugger Problem with CB 10.05
« Reply #2 on: August 03, 2010, 07:07:09 am »
Did you compile the code before debugging???

Yes.  In fact, I rebuilt the entire project between debugging sessions.  Twice.

Quote
Did you edit code while debugging???

No.  I even closed CB and restarted it three times, noted the c++ file was in fact saved with changes, and had the same problem recur.

Offline reckless

  • Regular
  • ***
  • Posts: 353
Re: Debugger Problem with CB 10.05
« Reply #3 on: August 03, 2010, 07:32:36 pm »
hmm not sure but maybe gdb caches old debugging data allthough it should update it if the code changes (bit lost on that one tbh).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Debugger Problem with CB 10.05
« Reply #4 on: August 03, 2010, 08:19:54 pm »
hmm not sure but maybe gdb caches old debugging data allthough it should update it if the code changes (bit lost on that one tbh).
I'm pretty sure that it doesn't.
The debug info is written in the resulting executable. So a rebuild should cause the compiler to regenerate it.

kartari: Try this:
1. Clean your project
2. Search your disk for file that have not been cleaned (.o and .exe/.dll/.a)
3. Delete all found files.
4. Debug your project config to understand why they are no cleaned.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline kartari

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Debugger Problem with CB 10.05
« Reply #5 on: August 03, 2010, 10:06:22 pm »
Haha, this is embarrassing!  I neglected to notice that the file I was debugging was in a different project from the one I was currently working on and rebuilding.  Both projects are my own, so I just need to rebuild the other project to update it.  Sorry for the alarm.  I was too busy to work on any programming projects since February and I guess my brain has rusted a bit.

Thanks for the help.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Debugger Problem with CB 10.05
« Reply #6 on: August 03, 2010, 10:17:22 pm »
so I just need to rebuild the other project to update it.  Sorry for the alarm.
For this purpose you can setup dependencies between projects in a workspace, or even dependencies on other (external) libraries / files. Then this will never happen again.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline kartari

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Debugger Problem with CB 10.05
« Reply #7 on: August 03, 2010, 10:31:30 pm »
Thanks MMF.