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 257000 - printf not showing up in console - can't step into/over fgets, debugger stops
Summary: printf not showing up in console - can't step into/over fgets, debugger stops
Status: RESOLVED WORKSFORME
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 8.1
Hardware: PC Windows 10 x64
: P2 normal (vote)
Assignee: henk89
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-05 10:16 UTC by adtewa
Modified: 2015-12-06 12:30 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description adtewa 2015-12-05 10:16:12 UTC
I shared the bug on stackoverflow:
http://stackoverflow.com/questions/34098451/netbeans-c-debugger-bug

In summary:

Printf is not showing up in the console not even after calling fflush(stdout).

When stepping into fgets, the debugger options are disabled, 

In the debugger console I can write a line and press enter multiple times no matter before or after stepping into fgets.

I tried MinGW and Cygwin gdb too. Same result.

I've read similar bug:
https://netbeans.org/bugzilla/show_bug.cgi?id=256985
Maybe they are related.
Comment 1 soldatov 2015-12-05 11:20:47 UTC
Can't reproduce. Which exact gcc, gdb, cygwin and mingw tools you are using? Versions? 32 or 64 bits?
Comment 2 soldatov 2015-12-05 11:42:09 UTC
(In reply to adtewa from comment #0)
> I tried MinGW and Cygwin gdb too. Same result.
Do you speak about Cygwin's GCC and Cygwin's GBD or you mixes MinGW and Cygwin tools?
If you uses MinGW tools you needs to set "Run|Console Type"="External Terminal" in Project Properties window. Did you see other behavior in NetBeans 8.0?
Comment 3 adtewa 2015-12-05 16:46:22 UTC
(In reply to soldatov from comment #2)
> (In reply to adtewa from comment #0)
> > I tried MinGW and Cygwin gdb too. Same result.
> Do you speak about Cygwin's GCC and Cygwin's GBD or you mixes MinGW and
> Cygwin tools?
> If you uses MinGW tools you needs to set "Run|Console Type"="External
> Terminal" in Project Properties window. Did you see other behavior in
> NetBeans 8.0?

"Run|Console Type"="External Terminal" is working! Both Cygwin and MinGW. I didn't mix them. It prints the string, and fgets is working too. Thanks for the solution.

Cygwin is 32 bit:
Cygwin gcc: 4.9.3
Cygwin gdb: 7.8

MinGW is i don't know, installer didn't say, guess it's 32bit:
MinGW gcc: 4.8.1
MinGW gdb: 7.6.1

Compileing and running is working in internal terminal, just the debugging working only in external terminal.

In Netbeans 8.0.2 I'm experiencing the same problems.
Comment 4 adtewa 2015-12-05 18:12:25 UTC
> Cygwin is 32 bit:

I have found out that 64bit cygwin was also installed. And Netbeans used cygwin 64bit somehow, but in the build tools i gave it the 32 bit bin directory.

I've installed cygwin 64 bit again with the gcc, g++, gdb, make.
Now It's working with Internal Terminal too with Cygwin.
Comment 5 Vladimir Voskresensky 2015-12-06 12:30:38 UTC
(In reply to adtewa from comment #4)
> > Cygwin is 32 bit:
> 
> I have found out that 64bit cygwin was also installed. And Netbeans used
> cygwin 64bit somehow, but in the build tools i gave it the 32 bit bin
> directory.
> 
> I've installed cygwin 64 bit again with the gcc, g++, gdb, make.
> Now It's working with Internal Terminal too with Cygwin.
So, closing as works-for-me.