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.
Hi, I am new to the community, so please forgive me if i have made any mistake in composing this mail. I know there is a similar bug filed for linux i.e Bug Number: 224840. This is a very high priority issue in our project using netbeans(I cannot reveal the project details as its internal), so any help or tips is appreciated. After connecting gdb to gdbserver (via attachDebugger), if run the code without any breakpoints, i am unable to pause or even add breakpoints at run time.Due to this behaviour i can no longer control the target.This behaviour was observed in MinGw, cygwin & arm-none-eabi-gdb.exe. I even observed this behaviour in normal localhost debugging, after analysing for a whole day i found that if the output terminal is "Internal" the pause and breakpoint is not working, but by changing the Output terminal to "External" or "Standard output" then its working.It seems the windows interrupt goes correctly to the external terminal based output but not for internal terminal (i.e console inside netbeans).I tried the same steps as above in gdbserver but it did not work. OS: Windows 7 compiler : MinGW v4.8.1, cygwin v4.8.2, arm-none-eabi-gcc 4.8.3 20140228 (release) Gdb: MinGW-gdb v7.6.1, cygwin-gdb 7.6.50.20130728-cvs, arm-none-eabi-gdb 7.6.0.20140228-cvs. Gdbserver: MingGw-gdbserver v7.6.1, The sample application used for testing is : ------------------------------------------------------- main.c ------------------------------------------------------- #include <stdio.h> #include <stdlib.h> void foo() { printf("Hello world"); } /* * */ int main(int argc, char** argv) { int i = 0; while (1) { i++; if (i % 6 == 0) { foo(); } } return (EXIT_SUCCESS); } After analysing the netbens "org.netbeans.modules.cnd.debugger.common2" source code i found that the pause in windows triggers a Windows interrupt via the application "GdbKillProc.ex" present inside the "netbeans_installed_loc/cnd/bin/".I thought by changing its code as below it would work, the code works in normal way however the the bug was still there. ---------------------------------- GdbKillProc.c ---------------------------------- #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0501 #endif #include <Windows.h> #include <stdio.h> #include <stddef.h> #include <stdlib.h> int main(int argc, char **argv) { unsigned pid = (unsigned) strtol(argv[3], NULL, 0); if (pid == 0) { printf("Process not found, returning 1."); return 1; } HANDLE proc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, (DWORD) pid); if (proc == NULL) { printf("Process not found, returning 2."); return 2; } // if (!DebugBreakProcess(proc)) { // return 3; // } int rc = -1; while(rc == -1) { rc = DebugBreakProcess(proc); if (rc == -1) Sleep(10); } printf("Success."); CloseHandle(proc); return 0; } Is the pause & breakpoint event lost when we run a code (without any intial breakpoint)? Due to this bug i am unable to do normal debugging in my project. Since this a high priority issue for my project any help would be greatly appreciated. Thank you.
This bug was observed in netbeans 7.4, 8.0 and 8.0.1
Any updates regarding this issue?
Is there any updates regarding this bug? Any workarounds would be gladly appreciated.
Created attachment 151196 [details] C Program containing infinte while loop without any printf statements.
Created attachment 151197 [details] C program with infinite loop with printf statements
Created attachment 151198 [details] MinGw Gdb-GdbServer (locally) log for debugWithoutPrintf.c using externalTerminal
Created attachment 151199 [details] MinGw Gdb-Gdbserver(locally)log for debugWithPrintf using internalTerminal
Created attachment 151200 [details] MinGw Gdb-GdbSever (locally) log for debugWithoutPrintf using internalTerminal
Created attachment 151201 [details] MinGw Gdb-norma local debugging log for debugWithPrintf.c using internalTerminal
I have currently provided the issue logs corresponding to MinGw, I do not have the setup of cygwin and arm-none-eabi-gdb.exe for providing the log files however I know both suffer from the same sort of issues. Debugging steps done on a program that runs a infinite while loop (program is attached below) Prerequisite: When debugging is started, the code runs continuously without any breakpoints Local debugging (without gdbserver): -------------------------------------------- Using Internal terminal: First program debugWithoutPrintf.c works fine. For second program debugWithPrintf.c (there is a printf being printed in the code) Pause button does not work Breakpoint addition does not work. Log file: gdb-normalDebugging-MinGw-debugWithPrintf-internalTerminal.log Using External terminal: Both debugWithPrintf.c and debugWithoutPrintf.c works fine. Using Standard output: Both debugWithPrintf.c and debugWithoutPrintf.c works fine. Debugging locally using MinGw-gdbserver: ---------------------------------------------------- Using Internal terminal: First program debugWithoutPrintf.c: Pause button does not work Breakpoint addition does not work. Error in terminal: C:\MinGW\bin>gdbserver.exe localhost:3333 D:\programs\DebugWithoutPrintf\dist\Debug\MinGW-Windows\debugwithoutprintf.exe Process D:\programs\DebugWithoutPrintf\dist\Debug\MinGW-Windows\debugwithoutprintf.exe created; pid = 2852 Listening on port 3333 Remote debugging from host 127.0.0.1 input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') Log file: : gdb-gdbSeverLocal-MinGw-debugWithoutPrintf-internalTerminal.log Second program debugWithPrintf.c: Pause button does not work Breakpoint addition does not work. Error in terminal: C:\MinGW\bin>gdbserver.exe localhost:3333 D:\programs\DebugWithoutPrintf\dist\Debug\MinGW-Windows\debugwithoutprintf.exe Process D:\programs\DebugWithoutPrintf\dist\Debug\MinGW-Windows\debugwithoutprintf.exe created; pid = 2852 Listening on port 3333 Remote debugging from host 127.0.0.1 input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') input_interrupt, count = -1 c = 0 (' ') Log file: gdb-gdbServerLocal-MinGw-debugWithPrintf-internalTerminal.log The same problem occurs for external and standard output Log file: gdb-gdbServerLocal-MinGw-debugWithoutPrintf-externalTerminal.log I have attached all the log files and the c files.
https://sourceware.org/bugzilla/show_bug.cgi?id=17760