Author Topic: How do you use the debugger?  (Read 5975 times)

nehpilim

  • Guest
How do you use the debugger?
« on: February 12, 2006, 06:03:48 am »
Hi guys.

How do you work the debugger? The menu for it is mostly  grayed out, including the "start" button.... I have GDB installed, and have set the compiler to use -g...

Thanks

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: How do you use the debugger?
« Reply #1 on: February 12, 2006, 08:59:26 am »
Version? Revision? Steps to reproduce?

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

nehpilim

  • Guest
Re: How do you use the debugger?
« Reply #2 on: February 12, 2006, 09:07:59 pm »
This isn't a PR, I'm just not sure how to use the debugger...what steps does one normally take to get it going? With MS Visual C++ I just hit start debugging, here it's all greyed out and I'm not sure why...

This is from svn as of two days ago.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: How do you use the debugger?
« Reply #3 on: February 12, 2006, 10:17:38 pm »
Quote
This isn't a PR, I'm just not sure how to use the debugger...what steps does one normally take to get it going? With MS Visual C++ I just hit start debugging, here it's all greyed out and I'm not sure why...

It works the same way.
But if you say it's all greyed out, you didn't read the link I gave you.
Let me try again, giving some emphasis this time:

Please, read this link :)...

We 're not asking for the info mentioned in that link just for the heck of it. It will provide us crucial information so that we can give you an answer that might help you...
Be patient!
This bug will be fixed soon...

nehpilim

  • Guest
Re: How do you use the debugger?
« Reply #4 on: February 13, 2006, 04:19:55 am »
Alright, it turns out I have to create a project just to use the debugge, not just a simple source file....well, I suppose thats better than MSVC++, which forces you to make a project just to COMPILE anything...

Well, I have a new issue. The debugger is now available, but doesn't work:

here is the output from it:


Compiling: done
Adding source dir: /home/paul/cpp/play/
Adding file: play
Starting debugger: done
Invalid debugger script: 'gdb_types.script'
Setting breakpoints
Debugger name and version: GNU gdb 6.4
No source file named /home/paul/cpp/play/main.cpp.
Breakpoint 1 (/home/paul/cpp/play/main.cpp:24) pending.
No source file named /home/paul/cpp/play/main.cpp.
Breakpoint 2 (/home/paul/cpp/play/main.cpp:23) pending.
Program exited normally.
Debugger finished with status 0

It can't find the file? It certainly exists, and that's the right location, why does it say No source file named...? This is the source from 10 feb. I will compile today's SVN and see if that helps, I will report back because on the 10th I know some debugging fixes went in...

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: How do you use the debugger?
« Reply #5 on: February 13, 2006, 07:29:07 am »
did you use a lib or a dll project. Not sure if it aplies also for a lib, but certainly a dll.

When you put a breakpoint in a source file, which is part of a dll or a lib, at first the breakpoint is pending, and the file is not founf. That not found means, the breakpoint was not found in the sourcefiles of the main app. The dll was not loaded yet, but once the dll is loaded and the flow of the program passes your breakpoint it will stop there.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: How do you use the debugger?
« Reply #6 on: February 13, 2006, 08:43:23 am »
You can go to "Settings->Compiler/debugger->Debugger" and check "Show debugger's debug log". This will show the detailed debugger's log which contains the complete conversation between the debugger and C::B.
If you still have problems, post this log too.
Be patient!
This bug will be fixed soon...

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: How do you use the debugger?
« Reply #7 on: February 13, 2006, 11:01:41 am »
I have had one time this problem (in Windows anyway, but it should be IMHO the same in Linux). The cause was that I have forgotten to compile my project with debugging symbols. Once added this option to the compiler options, gdb worked :D.

Michael