Re: Expect spawns on 64-bit Windows



LisaY wrote:

Any ideas on why Expect isn't seeing the I/O from myapp, and how I can
get this to work? Many thanks for any feedback.

Expect for Windows uses a rather bizarre method to intercept the text sent to
the console. As the concept of a pty style stream does not exist on the
windows platform, it was necessary to run the child in the system debugger and
catch all calls the app makes to any of the win32 console API functions in
break-points and copy the text from the parameters and push that text into a
stream. It's that stream emulation that is tricky and most likely the source
of the empty string under your running conditions.

If you don't mind doing some developer work, the source for E4W is available
so you can step-debug the, umm, step-debugger to find the bug. All the meat
is located in expWinConsoleDebugger.cpp and associates.

I know this is the problem with DOS-16 apps and E4W. The NTVDM does itself
have a limited debugger inside it, but the thunking of screen output from
direct memory access of DOS apps by the NTVDM to Win32 calls is unfortunately
happening on the kernel side of the fence.

If you determine that the thunk layer managing the cross from 32 to 64 is
happening in kernel-mode, there is no way the system debugger method can catch
those calls...

One of these days someone at Redmond might provide some appropriate
acceptability/handicap hooks for the console that would be perfect for E4W.

Square pegs can fit in round holes using a correctly weighted hammer.

--
David Gravereaux <davygrvy@xxxxxxxxx>
[species:human; planet:earth,milkyway(western spiral arm),alpha sector]


Attachment: signature.asc
Description: OpenPGP digital signature



Relevant Pages

  • Re: Switching from console to Wxwidgets app?
    ... Console ... follows MS statement that only native console apps are supported in ... Did you try running the vc_redist.exe that came with the SP1 update? ... MS really ought to push an "enhancement" rated Windows ...
    (microsoft.public.vc.language)
  • Re: upgrade mistake
    ... determined by the apps that you deem critical. ... VirtualPC is free but doesn't support USB devices. ... If you exit its console, ... She has greeting card software that will run under Windows ...
    (alt.comp.hardware.pc-homebuilt)
  • Re: Text-Based Windows Library
    ... Im looking for a library that can make windows and buttons inside ... console.. ... Many old apps were make like this, ... sell their ancient C-Scape product, which was not too awful to use, ...
    (comp.lang.c)
  • Re: Console Applications
    ... before closing so you can see what you output to console. ... I'm running Windows XP ... applications with out it shutting off on me? ... because I want to build Windows apps and not console apps right now? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: CreateProcessAsUser - Process starts then exits
    ... Windows XP Media Center ... public Int32 dwX; ... public IntPtr lpReserved2; ... parent's console. ...
    (microsoft.public.win32.programmer.kernel)