Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 385363 - No console output and ignore user's input functions when debugging.
Summary: No console output and ignore user's input functions when debugging.
Status: CLOSED DUPLICATE of bug 231883
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 8.1.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: cdt-debug-inbox@eclipse.org CLA
QA Contact: Doug Schaefer CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-18 00:39 EDT by hooluupog CLA
Modified: 2012-07-19 07:34 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hooluupog CLA 2012-07-18 00:39:46 EDT
Build Identifier: Version: Juno Release Build id: 20120614-1722

I'm running windows 7 32bit,eclipse juno for c++ developer 32bit and mingw32.
Two issue appears here when i debug my app:
1) No console output( eg.printf(...) ).  I googled the bug and add mingw path in eclipse ,it doesn't work.
2).Ignore my input function for me to input values.
 for example,
        char s[255],*p,*q;
	int i=0,n;
	fgets(s,255,stdin);// the debugger ignore the function and disallow me to give an input
	p = q = s;
*	s[strlen(s)-1] = '\0';// toggle breakpoint at this line


Reproducible: Always
Comment 1 hooluupog CLA 2012-07-18 01:15:25 EDT
FYI, After i added fflush(stdout) after printf() or added the following lines
 setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0); 
in the start of the main function to do debugging again,  the debugger halted and said:
 '*stopped,reason="end-stepping-range",frame={addr="0x004014f5",func="main",args=[],file="..\ReverseString.c",fullname="D:\Users\workspace\Reverse_String\ReverseString.c",line="36"},thread-id="1",stopped-threads="all"' .
Comment 2 hooluupog CLA 2012-07-18 02:27:39 EDT
I hava tried again and found some interest thing. if i changed my code from 'printf("%c",*p)' to 'printf("%c\n",*p)', the debugger console finally showed the output. Seems as if the standard output is buffered and the buffer is flushed on newline during debugging. But it always shows output normally when i just run my app,	that ' s weird.
Comment 3 hooluupog CLA 2012-07-18 23:40:07 EDT
After i added "set new-console on" command into .gdbinit file and now eclipse debugger works well with externel input/output console window(it shows output and waits for my input before running at the breakpoint ). Maybe the bug is only related to eclipse's internal console on windows OS platform.
Comment 4 Marc Khouzam CLA 2012-07-19 07:34:39 EDT

*** This bug has been marked as a duplicate of bug 231883 ***