Author Topic: debugging on linux: strange symbols, files open twice, "nothing to be done"  (Read 42094 times)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: debugging on linux: strange symbols, files open twice, "nothing to be done"
« Reply #15 on: September 16, 2008, 09:51:32 pm »
Right, this seems to be some kind of gcc/gdb bug.
This bug can be circumvented by removing the "virtual" keyword from the TestDebugger class' ancestors list

Code
class TestDebugger : public foo::Base1 ,public Base2
Be patient!
This bug will be fixed soon...

Offline CuteAlien

  • Multiple posting newcomer
  • *
  • Posts: 57
Re: debugging on linux: strange symbols, files open twice, "nothing to be done"
« Reply #16 on: September 16, 2008, 10:38:21 pm »
Right, this seems to be some kind of gcc/gdb bug.
This bug can be circumvented by removing the "virtual" keyword from the TestDebugger class' ancestors list

Code
class TestDebugger : public foo::Base1 ,public Base2

That would work in my reduced test-case... but the real classes are derived from a class doing the reference-counting so that would introduce diamond inheritance problems :-(

Edit: I'll report it to the gdb people.
« Last Edit: September 16, 2008, 11:07:32 pm by CuteAlien »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: debugging on linux: strange symbols, files open twice, "nothing to be done"
« Reply #17 on: September 16, 2008, 11:45:37 pm »
Have you tried to use a pointer ?

Code
TestDebugger* iAmTheBug;

That works for me in the test-case.

Offline CuteAlien

  • Multiple posting newcomer
  • *
  • Posts: 57
Re: debugging on linux: strange symbols, files open twice, "nothing to be done"
« Reply #18 on: September 17, 2008, 02:35:52 am »
Have you tried to use a pointer ?

Thanks, nice workaround :-) That way I can actually debug it.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: debugging on linux: strange symbols, files open twice, "nothing to be done"
« Reply #19 on: September 17, 2008, 09:40:58 am »
... but the real classes are derived from a class doing the reference-counting so that would introduce diamond inheritance problems :-(
(emphasis added)

Which is why you shouldn't create such objects on the stack but only on the heap...
So, Jens is right (again) :) :

Have you tried to use a pointer ?

Be patient!
This bug will be fixed soon...

Offline CuteAlien

  • Multiple posting newcomer
  • *
  • Posts: 57
Re: debugging on linux: strange symbols, files open twice, "nothing to be done"
« Reply #20 on: September 17, 2008, 02:50:29 pm »
Which is why you shouldn't create such objects on the stack but only on the heap...
So, Jens is right (again) :) :

Yeah, yeah, but sometimes you want to use classes in different contexts and except for debugging that would have worked. In that case it was a context specifically created for debugging, so every class needed was just in the function *sigh*.

Anyway, I could debug now, but while doing that I found out that I was too early when I announced that the problem with the strange symbols that get inserted sometimes in the sourcecode (mentioned at the start of thread) has been fixed with the newer nightly build I'm using. It certainly got a lot better, but I think it's somehow related to the speed of the debugger. When I stepped deeper and deeper into a library the stepping started to take more and  more time. And as soon as that happened I got the strange characters back when I pressed on stepping before the debugger was finished with it's current step. So that might also be something worth looking into.