Search code examples
debuggingwindows-ce

How to debug wince exe directly without using a vcproj


I'd like to humbly ask: How can I debug a wince executable(.exe) that has been stored on the wince device, using Visual Studio's debugging facility.

As we all know, using VS2005, we can create a Win32 Smart Device Project(.vcproj),add our source files to it, compile, select a target device, and press F5, then the generated exe will be deployed to the wince device and gets attached to the VS2005 wince debugger. But I'd really like to know, if someone has a wince exe(call it stock) already in his wince-device and have source code corresponding to that exe, HOW DO I start debugging that stock exe directly WITHOUT compiling the source code? I cannot compile the source code perhaps because I'm missing some library source or other reason.

For PC program, I know I can open an exe as a project so to start debugging that exe. I can find the main() function and set a break point on its first statement, then F5 will stop at that break point.

Thank you in advance.


Solution

  • I often run into this problem as well; I wish the "exe project" created would allow changing the debugger to "Smart Device Native Debugger" (or somehow set the platform) -> Let me know if someone knows how to do that.

    The two ways I have been able to work around this are:

    1. New Project Method:

      • Create an empty "Smart Device" project with no source code.
      • Change the "Configuration Properties > Debugging > Remote Executable" to your "Stock EXE" that you put on the device, ie: \FlashDisk\MyApp.exe
      • F5 to debug, and choose "Yes" when it says "deployment errors, do you wish to continue".
    2. Attach to Process Method:

      • Same as above, but, instead of editing "Remote Executable" just start the "Stock EXE" via rapistart.exe / running manually via screen. Then make sure the "Attach to Process" transport is set to "Smart Device" and you should be able to attach.

    After this you need to manually load the pdb, choose src files, etc, as you would a normal PC app.