Bug 290215 - [KeyBindings] Pressing Ctrl-Z in Console View doesn't send EOF to a application while debugging
Summary: [KeyBindings] Pressing Ctrl-Z in Console View doesn't send EOF to a applicati...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 6.0   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: cdt-debug-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-23 02:59 EDT by Denis Nedelyaev CLA
Modified: 2020-09-04 15:21 EDT (History)
7 users (show)

See Also:


Attachments
Debug trace with correct Ctrl-Z functionality (94.71 KB, text/plain)
2009-09-23 07:32 EDT, Denis Nedelyaev CLA
no flags Details
Debug trace with incorrect Ctrl-Z functionality (96.01 KB, text/plain)
2009-09-23 07:33 EDT, Denis Nedelyaev CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Nedelyaev CLA 2009-09-23 02:59:46 EDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 GTB5 (.NET CLR 3.5.30729)
Build Identifier: 20090619-0625

It's work in Run mode, but not in Debug.

I use Eclipse IDE for C/C++ Developers on Windows XP.
I haven't tried it in Linux.

The symptoms is like in:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=217922


Reproducible: Always
Comment 1 Paul Webster CLA 2009-09-23 06:39:00 EDT
Denis, could you run some tracing (an example of EOF when it works and an example of EOF when it doesn't).  http://wiki.eclipse.org/Platform_Command_Framework#Tracing_Option

commandId = org.eclipse.debug.ui.commands.eof

Specify the commandId to get specific eof command information.

PW
Comment 2 Denis Nedelyaev CLA 2009-09-23 07:32:32 EDT
Created attachment 147882 [details]
Debug trace with correct Ctrl-Z functionality

Used debug options:

org.eclipse.ui/debug=true
org.eclipse.ui/trace/keyBindings=true
org.eclipse.ui/trace/keyBindings.verbose=true
org.eclipse.ui/trace/sources=true
org.eclipse.ui/trace/handlers=true
org.eclipse.ui/trace/handlers.verbose=true
org.eclipse.ui/trace/handlers.verbose.commandId=org.eclipse.debug.ui.commands.eof
org.eclipse.ui/trace/contexts=true
org.eclipse.ui/trace/contexts.verbose=true
Comment 3 Denis Nedelyaev CLA 2009-09-23 07:33:18 EDT
Created attachment 147883 [details]
Debug trace with incorrect Ctrl-Z functionality

Used debug options:

org.eclipse.ui/debug=true
org.eclipse.ui/trace/keyBindings=true
org.eclipse.ui/trace/keyBindings.verbose=true
org.eclipse.ui/trace/sources=true
org.eclipse.ui/trace/handlers=true
org.eclipse.ui/trace/handlers.verbose=true
org.eclipse.ui/trace/handlers.verbose.commandId=org.eclipse.debug.ui.commands.eof
org.eclipse.ui/trace/contexts=true
org.eclipse.ui/trace/contexts.verbose=true
Comment 4 Paul Webster CLA 2009-09-23 07:43:54 EDT
Thanx Denis,

From your trace where EOF didn't work, it still looks like we're executing the handlers:

HANDLERS >>> Command('org.eclipse.debug.ui.commands.eof') has changed to 'org.eclipse.debug.internal.ui.views.console.ProcessConsolePageParticipant$EOFHandler@1770bec' as its handler
KEYS >>> Listener.handleEvent(type = KeyDown, stateMask = 0x0, keyCode = 0x30, time = 23555078, character = 0x30)
KEYS >>> WorkbenchKeyboard.press(potentialKeyStrokes = [0])
KEYS >>> Listener.handleEvent(type = Traverse, stateMask = 0x0, keyCode = 0xd, time = 23555796, character = 0xd)
KEYS >>> WorkbenchKeyboard.press(potentialKeyStrokes = [CR])
KEYS >>> Listener.handleEvent(type = KeyDown, stateMask = 0x0, keyCode = 0xd, time = 23555796, character = 0xd)
KEYS >>> WorkbenchKeyboard.press(potentialKeyStrokes = [CR])
KEYS >>> Listener.handleEvent(type = KeyDown, stateMask = 0x0, keyCode = 0x40000, time = 23556031, character = 0x0)
KEYS >>> Listener.handleEvent(type = KeyDown, stateMask = 0x40000, keyCode = 0x7a, time = 23556578, character = 0x1a)
KEYS >>> WorkbenchKeyboard.press(potentialKeyStrokes = [CTRL+Z])
KEYS >>> WorkbenchKeyboard.executeCommand(commandId = 'org.eclipse.debug.ui.commands.eof', parameters = {})

I've passed this onto Debug to comment.

It looks like the handler is set correctly and we're executing the command.  But the symptom is this works in Run mode but not in Debug.

PW
Comment 5 Darin Wright CLA 2009-09-23 10:39:35 EDT
Works for me in run and debug mode using the Eclipse SDK and Java debugger. Moving to CDT for comment.
Comment 6 Denis Nedelyaev CLA 2009-09-25 04:42:59 EDT
I tried following on Linux. (Eclipse IDE for C/C++ Developers, Build id: 20090619-0625)

The program's source code is:

#include <stdio.h>
int main() {
   int n;
   while (scanf("%d", &n) != EOF) {
      printf("echo: %d\n", n);
      fflush(stdout);
   }
   printf("end of input\n");
   fflush(stdout);
}

After launching the program in a Linux terminal, I can enter:

1<ENTER>
2<ETRER>
3<ENTER>
<CTRL+D>

to get this:

echo: 1
echo: 2
echo: 3
end of input

But if I enter the same in Eclipse, then it output just this:

echo: 1
echo: 2
echo: 3

There is no "end of input". And when I enter new numbers, it doesn't echoes.

Seems that it stops send new input to the program but not sends EOF.

So the Linux port have same problem. And it doesn't work even in Run mode (not only in Debug).
Comment 7 Axel Mueller CLA 2010-08-12 03:13:04 EDT
Is a duplicate of bug #159803
Comment 8 Matias Giangualano CLA 2020-03-24 11:35:11 EDT
There is the same problem in Eclipse MARS 3.2 on Windows 8 and Java SE.

In Debugging Perspective, the console does not recognize EOF signal (ctrl + z).

Here it is my workaround:

change perspective and then focus by clicking on another form.

After that go back to debug perspective and then click to the console form.

Now press crtl + z (EOF on Windows) and it should catch the right input