Udostępnij za pośrednictwem


Differences Between Device And Desktop Debuggers

Device debuggers support most of the same features that desktop debuggers support, with the following exceptions.

Edit and Continue Not Supported

Device debuggers do not support the ability to modify the source and continue while in break mode. If you want to modify your code while debugging, you must stop debugging, edit your code, and then restart with the modified sources. If you try to change your code while in break mode, the debugger issues a warning.

Function Evaluation Not Supported in Native Debugger

The native device debugger does not support function evaluation. You cannot type an expression that contains a function and have it evaluated with returned results.

The managed device debugger does support function evaluation.

Interop Debugging Limitations

You cannot debug native and managed code in a single instance of the debugger.

To debug applications that have mixed native and managed code (or managed code that uses pInvoke), set breakpoints in each section where you want to begin to step through your code. Then, attach whichever debugger is required for a certain section (for example, a managed section). Detach that debugger and attach the other when it is needed. You can repeat these detach/attach steps as often as that is required to step through your program. For more information, see Walkthrough: Debugging a Solution that Includes Both Managed and Native Code.

Using the two debugging instances at the same time on the same process is currently not supported.

Attribute-Based Debugging Not Supported

The .NET Compact Framework does not currently support attribute-based debugging. Thus, the ability to define attributes for visualizers and so on is unavailable for users of the device debuggers.

Desktop Debugging Not Supported

You cannot use the device debuggers to debug applications written for the desktop. Use the desktop debuggers instead.

Kernel Debugging Not Supported

You cannot use the device debuggers for kernel debugging.

Just My Code Debugging Not Supported

You cannot use Just My Code debugging.

Runtime Debugger (Cordbg.exe) Additions

The Runtime Debugger helps tools vendors and developers find and fix bugs in programs that target the .NET Framework common language runtime (CLR). Device projects add a new command and a new mode argument to the Runtime Debugger. The syntax for the new command and mode argument (inside a Cordbg.exe session) is described in the following table.

For more information and complete syntax, see Runtime Debugger (Cordbg.exe).

Command

Description

m[ode] EmbeddedCLR {0|1}

EmbeddedCLR is a mode argument that sets the debugger to target device projects. To control this setting, specify 1 for on or 0 for off.

conn[ect] machine_name port

Connects to a remote embedded CLR device.

Parameters:

Machine_name

Required. The name or IP address of the remote computer.

Port

Required. The port to use to connect to the remote computer.

Connection Issues

Turning off the device while the debugger is running causes the debugger to close because of the connection failure. The connection failure occurs because the application is still running in the background on the device. The X button on the Pocket PC is a smart minimize feature and does not close the application. Instead it sets the application to run in the background.

To correctly close an application that is running in the background on a Pocket PC, follow these steps:

From the Start menu, select Settings, click the System tab, and then tap Memory. On the Running Programs tab, tap the application that you want to close, and tap Stop.

See Also

Other Resources

Debugger Roadmap

Debugging Device Projects