Author Topic: Can't run debugger  (Read 57365 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Can't run debugger
« Reply #15 on: September 10, 2010, 09:27:32 pm »
So you have some configuration problem....
Does the avr gdb run from the console?
(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 scarphin

  • Lives here!
  • ****
  • Posts: 640
Re: Can't run debugger
« Reply #16 on: September 10, 2010, 09:30:49 pm »
Yes, without any problem!

Offline scarphin

  • Lives here!
  • ****
  • Posts: 640
Re: Can't run debugger
« Reply #17 on: September 12, 2010, 10:58:50 am »
I also realized, although the debugger doesn't start it's like codeblocks enters a debug state and stays there. When I open another project it asks if it should stop the debugger or after I try to debug an AVR project with nothing visually appearing nor starting, I cannot start debug for a mingw console application which I can if I don't start it for AVR first. Where can I access the settings for the debugger command line scripts?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Can't run debugger
« Reply #18 on: September 12, 2010, 11:50:47 am »
Where can I access the settings for the debugger command line scripts?
Cannot compute... are you asking for the command options used to launch the debugger? (if so, look in the code src/plugins/debuggergdb/*)
When you start the debugger in AVR project do you have gdb running (look in the task manager)?
Also do you see the debug log in when you debug console application with mingw's gdb?

(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 scarphin

  • Lives here!
  • ****
  • Posts: 640
Re: Can't run debugger
« Reply #19 on: September 13, 2010, 02:41:19 pm »
Yes it was command options I was asking for and I guess I can't change them without compiling codeblocks, like from some settings menu, right? I'm trying on the 3rd different machine now on an XP OS and behavior is the same as the 2 before. Debugging with MinGW works but nothing happens with 'avr gdb' and 'mingw' doesn't work afterwards. There isn't any trace of 'gdb' nor anything else related with gdb on the task manager and yes I see the debug log and everything else when debugging with 'mingw's gdb'. I ran out of ideas! Thnx for the help...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Can't run debugger
« Reply #20 on: September 13, 2010, 03:53:50 pm »
You can try the latest nightly for the debuggers branch and if that doesn't work you've two options:
1. build and debug c::b yourself
2. provide extremely detailed list of steps you're executing, from the compiler installation to the pressing of f8, also I'll need the links to download the compiler and debugger you're using, and a simple test project.

1. will be faster, because I don't like switching to windows too much :)
(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 scarphin

  • Lives here!
  • ****
  • Posts: 640
Re: Can't run debugger
« Reply #21 on: September 13, 2010, 09:38:12 pm »
I'm grateful for ur help. I'm only experienced in C for 8-16 bit microcontrollers and without any experience in C++ so option 1 is not possible by my side, I apologize for that. As for option 2, there exists a list below. ;) That's what I've done for my 3rd try on a 32-bit XP:

1 - I installed codeblocks 10.05 with mingw under 'C:\Program Files\codeblocks' and moved the mingw directory to 'C:\GNU\MinGW' and added 'C:\GNU\MinGW\bin' to PATH
2 - Here is the link for the latest winavr installation
http://sourceforge.net/projects/winavr/files/WinAVR/20100110/WinAVR-20100110-install.exe/download
on the page
http://sourceforge.net/projects/winavr/files/
I installed it under 'C:\GNU\WinAVR' and it adds 'C:\GNU\WinAVR\bin;C:\GNU\WinAVR\utils\bin' to path but I aligned path to make 'C:\GNU\MinGW\bin' come first.
3 - In codeblocks under 'compiler and debugger' settings I corrected compiler's install directory 'C:\GNU\MinGW' for MinGW and 'C:\GNU\WinAVR' for AVR GCC Compiler.
4 - For debugger settings only 'auto-build project to ensure up to date', 'add other open projects paths' and 'do not run debugee' options are not checked.
5 - I attached the project I use to test with the '.cbp' and other files. The project resides in drive 'D:'. It builds without any problems

That's all the changes I made to codeblocks. I think the project options reside in the '.cbp' file if not I'll also list them if needed.

And 1 last thing. I know codeblocks is free and provided 'as is'. I didn't expect for that much help and ur help is much appreciated, thank u! ;)


[attachment deleted by admin]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Can't run debugger
« Reply #22 on: September 13, 2010, 10:41:58 pm »
Why do you add the compilers to the PATH?
Can you try without?
Can you try to misspell the debuggers executable name in the toolchain options?
(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 scarphin

  • Lives here!
  • ****
  • Posts: 640
Re: Can't run debugger
« Reply #23 on: September 13, 2010, 11:13:09 pm »
I add them to path because winavr asks for it and mingw installer also adds it. I tried without compilers in the path, unfortunately same result. When I misspell debugger executable name, codeblocks gives the error 'The debugger executable is not set. To set it, go to...'! There is another detail needs to be told. After nothing happens when I try to run avr debugger with correct executable name, I don't get the error above even I misspell the debugger executable. Nothing changes until I quit and start codeblocks again and then I can get the error above again. It's like codeblocks is waiting for the avr-gdb to start but it never starts and codeblocks debug plugin hangs in the debug state somehow waiting for something. Just my guess.

Offline scarphin

  • Lives here!
  • ****
  • Posts: 640
Re: Can't run debugger
« Reply #24 on: September 15, 2010, 12:35:16 pm »
Ok I've found the problem. In 'Project/Properties' menu under 'Build targets' tab, when u set the type to 'Native' on the 'Selected build target options' which I do for embedded applications, the problem appears. Even when the type is set to 'Native' for the MinGW compiler, the debugger doesn't run like the avr-gdb. Is this the normal behavior for the 'Native' type or should a bug report be filled? Afaik only the linking commands under 'Advanced compiler options' change when the type is changed, don't they?
« Last Edit: September 15, 2010, 12:37:15 pm by scarphin »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Can't run debugger
« Reply #25 on: September 15, 2010, 01:18:56 pm »
The bug happens when you change from console to native?
This options should not change your build options (at least on linux it doesn't), it just tell's C::B to launch a console for you when you debug/run your project.

(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 scarphin

  • Lives here!
  • ****
  • Posts: 640
Re: Can't run debugger
« Reply #26 on: September 15, 2010, 01:41:25 pm »
The bug happens when you change from console to native?

Yes, definitely!!! I even confirmed this on another Vista box for the 4th time. I installed cb 10.05 and winavr with everything default. And when I change the type to 'native', avr-gdb doesn't run nor anything visible happens and my guess is the debugger plugin hangs. After restarting cb and if the type is set to 'Console application', avr-gdb and logging works without a problem.

Below is the linker commands which I copied from 'Advanced compiler options' for 'AVR GCC Compiler' in the order 'link executable', 'link console executable' and 'link native executable'. Last 2 is the same but that's not the case for MinGW.

$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs -mwindows
$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs
$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs

Do I get any advantage by setting the type to 'native' for embedded applications as doing so doesn't launch the debugger? I think that's a bug to be confirmed. Thnx...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Can't run debugger
« Reply #27 on: September 15, 2010, 02:05:13 pm »
Don't know if it is a bug, I'm not an embedded developer.

If you try the same steps with the mingw, do you get the same behavior? If you do, then this is a bug :)
(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 scarphin

  • Lives here!
  • ****
  • Posts: 640
Re: Can't run debugger
« Reply #28 on: September 15, 2010, 02:56:58 pm »
If I set the type to 'Native' for MinGW, the debugger won't start and there is nothing on the 'Debugger (debug)' tab as I mentioned before. So this must be a bug. Am I allowed to fill in a bug report for this?

Edit: I also wonder if this is the case for linux version or not! If not then this is related to windows versions with Vista and XP confirmed.
« Last Edit: September 15, 2010, 03:00:11 pm by scarphin »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Can't run debugger
« Reply #29 on: September 15, 2010, 04:26:59 pm »
First try the latest normal nightly and then the debuggers branch nightly...
(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!]