Author Topic: Debugging with external debugger  (Read 8334 times)

Curtisc

  • Guest
Debugging with external debugger
« on: May 25, 2006, 04:57:15 pm »
I just switched my work computer to linux, and I now need to recompile some custom modules for a program (Amira 3.1.1).  I like the looks of code::blocks better than eclipse, but I can't seem to figure out how to create a blank project that will allow me to use my own (amira created) makefile, as well as specify the program as an external debugger.  Any hints?

Also... I tried just importing the VC++ 6.0 files, and the program crashed each time I opened it.  Can that even work on linux?

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Debugging with external debugger
« Reply #1 on: May 25, 2006, 05:07:15 pm »
Also... I tried just importing the VC++ 6.0 files, and the program crashed each time I opened it.  Can that even work on linux?

Which C::B version? If RC2 try the latest nightly build.

Best wishes,
Michael

Curtisc

  • Guest
Re: Debugging with external debugger
« Reply #2 on: May 25, 2006, 05:30:19 pm »
I'm using the May 24 build.

I think I need to recreate the project anyway, so I'm not going to bother with the visual studio stuff - I've got all sorts of custom library paths and all that and it's just easier to have Amira make the makefile for me.  So far I've got it so that if I make it through the command line, it's finding all the right headers and everything but there's a few errors (probably related to compiler differences), so I'd rather be using an IDE.  Now I just need to go back to my original problem - how do I specify an external debugger?  I tried running the program and attaching to the process number, but that didn't seem to work.

Curtisc

  • Guest
Re: Debugging with external debugger
« Reply #3 on: May 25, 2006, 05:47:45 pm »
Ok... now I'm just creating a new project, and every time I try to add files to it it crashes.  Maybe the old version is more stable?

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Debugging with external debugger
« Reply #4 on: May 25, 2006, 10:53:01 pm »
Ok... now I'm just creating a new project, and every time I try to add files to it it crashes.  Maybe the old version is more stable?

That's strange. You just add new files to a cb project and C::B crashes? I have had problems with remove files from a project, but now with adding... :?

Could you please describe a bit more in details what you are doing?

Thanks.

Best wishes,
Michael

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Debugging with external debugger
« Reply #5 on: May 25, 2006, 11:42:02 pm »
Ok... now I'm just creating a new project, and every time I try to add files to it it crashes.  Maybe the old version is more stable?

What OS are you using? There have been some other posts about linux crashes when adding/removing files. I can't remember the distro though. I think it was either Gentoo or Suse...
Be patient!
This bug will be fixed soon...

Curtisc

  • Guest
Re: Debugging with external debugger
« Reply #6 on: May 26, 2006, 05:17:24 am »
I'm running Ubuntu (Dapper).

The crashing seems to be fairly random - I'll add a file and it will be fine, then I try another and it will crash.  Then I can restart it and try again, and the one that worked the first time will cause the crash!  If I try and recursively add a folder of files, it's guaranteed to crash.

I'm not adding new files, I'm adding files that already exist.  Maybe if I add new files and copy the code over from gedit or something?  I might try that tomorrow.  It would still be nice to have the problem resolved.

In detail, Amira creates a directory structure that it likes, and creates a GNUMakefile.  It also creates some default files (ProjectName.h, ProjectName.cpp, Version.h, etc), which I have written over with source code copied from the same project that was compiled for windows.  Then, in C::B, I created a new cb project in the same directory, and when I try to add my source code files, I get the crashing thing.  It also crashes when I try to attach the debugger to Amira.  I also tried importing the old VC++ 6.0 file, and that made it crash.

Would there be a crash log generated somewhere?  The only thing I could find was /tmp/Code::Blocks-charlotte, and it didn't seem to contain anything.

It's funny I'm having so many problems, I'd expect this to be a relatively common thing to do.  Hopefully I can figure out what's causing it - I like the looks of C::B more than the others I've tried (Anjuta and Eclipse).

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Debugging with external debugger
« Reply #7 on: May 26, 2006, 08:23:45 am »
Quote
I'm running Ubuntu (Dapper).
Quote
It's funny I'm having so many problems, I'd expect this to be a relatively common thing to do.

Yeah, strange. Especially Ubuntu has been extensively tested (Breezy though).
Have you tried disabling the code-completion plugin (you have to restart C::B then)? There have been some changes there lately and I wouldn't be surprised if it was the problem...
Be patient!
This bug will be fixed soon...

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Debugging with external debugger
« Reply #8 on: May 26, 2006, 11:12:28 am »
Quote
I'm running Ubuntu (Dapper).
Quote
It's funny I'm having so many problems, I'd expect this to be a relatively common thing to do.

Yeah, strange. Especially Ubuntu has been extensively tested (Breezy though).
Have you tried disabling the code-completion plugin (you have to restart C::B then)? There have been some changes there lately and I wouldn't be surprised if it was the problem...

Yes, it is quite strange :?. Ubuntu is relatively stable (at least 5.10). I will give it a look later, as now I have some crashes in my project's application :).

Best wishes,
Michael

Curtisc

  • Guest
Re: Debugging with external debugger
« Reply #9 on: May 26, 2006, 04:32:17 pm »
Success (sort of)!

Since I'm not actually developing anything at the moment, I figured I didn't need most of the plugins, so I disabled them all except for the compiler and debugger.  No more crashing problems - definitely a plugin issue.  Now I just need to figure out how to configure C::B to use Amira as an external debugger.  I tried just running Amira and attaching my module to the PID, but Amira just hangs and I can't load the module.  Is there some way to configure an external debugger?

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Debugging with external debugger
« Reply #10 on: May 26, 2006, 05:47:28 pm »
The crashing seems to be fairly random - I'll add a file and it will be fine, then I try another and it will crash.  Then I can restart it and try again, and the one that worked the first time will cause the crash!  If I try and recursively add a folder of files, it's guaranteed to crash.

Hello,

I have tried for some time (Ubuntu 5.10, .deb package of yesterday (rev2509), console application) and had no crashes when adding (recursively or not) and by removing files from a project.

May be your problem is local.

[EDIT]: And I have activated all the possible plugins :).

Best wishes,
Michael

Curtisc

  • Guest
Re: Debugging with external debugger
« Reply #11 on: May 26, 2006, 09:08:55 pm »
Quote
May be your problem is local.

I would not be surprised in the least if this were the case.  The computer I am working on has a history of random, inexplicable problems.

I think C::B is stable now - I even managed to import a VC++ 6.0 project, although it ended up beaing easier just to configure a blank project.  However, I still haven't figured out how to use an external debugger - it doesn't work to just attach to a running process.  Is there an option similar to VC 6.0 that will launch a program for debugging?  I am creating a library (modulename.so).

Curtisc

  • Guest
Re: Debugging with external debugger
« Reply #12 on: May 29, 2006, 05:14:37 pm »
STILL haven't figured it out, this is driving me crazy!  Anybody?  Please?  Is there some magic way to set it to launch a program for debugging?  I may have to go back to windows...

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Debugging with external debugger
« Reply #13 on: May 29, 2006, 06:28:58 pm »
Is there some magic way to set it to launch a program for debugging?

Can you explain *exactly* (i.e. step by step) what you want?
I fail to see what's troubling you...
Be patient!
This bug will be fixed soon...