This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 242915

Summary: Cannot debug a C++ application using MinGW/MSYS
Product: cnd Reporter: skomisa
Component: DebuggerAssignee: henk89
Status: RESOLVED INCOMPLETE    
Severity: normal    
Priority: P2    
Version: 8.0   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: Screenshot of NetBeans C++ MinGW Tools Collection settings

Description skomisa 2014-03-14 21:45:34 UTC
Created attachment 146034 [details]
Screenshot of NetBeans C++ MinGW Tools Collection settings

Overview: I am testing the C++ setup under NetBeans 8 using Cygwin and MinGW. Cygwin works fine, but I cannot run in debug mode using MinGW.

Steps to Reproduce:
- Download and install MinGW/MSYS from SourceForge.
- Ensure DOS PATH includes C:\MinGW\bin;C:\MinGW\MSYS\1.0\bin
- Ensure Tools Collection is set correctly for MinGW in NetBeans (Tools => Options => C/C++)
- Create a basic C++ project named "Welcome_D" based on the C++ Welcome project.
- Build and run. Everything works fine.
- Now rerun in debug mode. A popup "Debugger Error" dialog is displayed with this message: 
\"C:\\Users\\JohnDoe\\Documents\\NetBeansProjects\\Welcome_D\\dist\\Debug\\MinGW2-Windows\\welcome_d.exe\": not in executable format: 
File format not recognized

Additional Information:

I have pasted the content of the Debugger console and the Debugger log file below. I have also attached a screen shot of the Tool Collection screen.

This is the content of the Debugger console:

This log is saved to: C:\Users\JohnDoe\AppData\Local\Temp\gdb-cmds4406499029766886803.log
NB build: 201403140001
~"GNU gdb (GDB) 7.6.1\n"
~"Copyright (C) 2013 Free Software Foundation, Inc.\n"
~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\nand \"show warranty\" for details.\n"
~"This GDB was configured as \"mingw32\".\nFor bug reporting instructions, please see:\n"
~"<http://www.gnu.org/software/gdb/bugs/>.\n"
(gdb) 


This is the content of the Debugger log file:

This log is saved to: C:\Users\JohnDoe\AppData\Local\Temp\gdb-cmds4406499029766886803.log

NB build: 201403140001

=thread-group-added,id="i1"
~"GNU gdb (GDB) 7.6.1\n"
~"Copyright (C) 2013 Free Software Foundation, Inc.\n"
~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\nand \"show warranty\" for details.\n"
~"This GDB was configured as \"mingw32\".\nFor bug reporting instructions, please see:\n"
~"<http://www.gnu.org/software/gdb/bugs/>.\n"
&"C:\\\\Users\\\\JohnDoe/.gdbinit: No such file or directory.\n"
(gdb) 
2-list-features
3-gdb-set print repeat 0
4-gdb-set backtrace limit 1024
5-gdb-set print elements 400
6-gdb-set follow-fork-mode parent
7-gdb-set detach-on-fork on
8-enable-pretty-printing
9-file-symbol-file "C:/Users/JohnDoe/Documents/NetBeansProjects/Welcome_F/dist/Debug/MinGW-Windows/welcome_f"
10-file-exec-file  "C:\\Users\\JohnDoe\\Documents\\NetBeansProjects\\Welcome_F\\dist\\Debug\\MinGW-Windows\\welcome_f"
2^done,features=["frozen-varobjs","pending-breakpoints","thread-info","data-read-memory-bytes","breakpoint-notifications","ada-task-info"]
(gdb) 
3^done
(gdb) 
4^done
(gdb) 
5^done
(gdb) 
6^done
(gdb) 
7^done
(gdb) 
8^done
(gdb) 
9^error,msg="`C:\\Users\\JohnDoe\\Documents\\NetBeansProjects\\Welcome_F\\dist\\Debug\\MinGW-Windows\\welcome_f.exe': can't read symbols: File format not recognized."
(gdb) 
10^error,msg="\"C:\\Users\\JohnDoe\\Documents\\NetBeansProjects\\Welcome_F\\dist\\Debug\\MinGW-Windows\\welcome_f.exe\": not in executable format: File format not recognized"
(gdb)
Comment 1 soldatov 2014-03-15 10:51:01 UTC
Strange story. I think it should be investigated.
Comment 2 henk89 2014-04-14 12:50:24 UTC
I'm unable to reproduce it with the newest GDB (7.6.1) and GCC. Could you forget to update gcc and g++?
Comment 3 henk89 2014-04-16 11:58:17 UTC
It looks like you updated the compiler and forgot to update the debugger (or the opposite way).