Debugging NetCF applications using cordbg — Part III

In Part II  of NetCF debugging with cordbg, I talked about my favorite debugger modes.

Today, I want to discuss the cordbg commands which are not supported when debugging .NET Compact Framework projects. Please note that this list is accurate as of NetCF version 1, when being debugged using cordbg version 1.1.4322. 

a[ttach]            Attach to a running process
pro[cessenum]       Display all managed processes running on the system
regd[efault]        Change the JIT debugger
r[un]               Start a process for debugging
reg[isters]         Display CPU registers for current thread
setip               Set the next statement to a new line
uw[here]            Display an unmanaged stack trace (Win32 mode only)
ut[hreads]          Set or display unmanaged threads (Win32 mode only)
uc[lear]            Clear the current unmanaged exception (Win32 mode only)

As you can see, the list is pretty small.


The NetCF debugger API does not allow for enumerating, or attaching to, processes on the remote device.  If you wish
to attach to a process, you will need to launch it for debugging on the device and then use the connect command (see Part I).  Basically, this means you need to debug a NetCF application from the start of execution.

NetCF does not support changing the JIT debugger.  Attempting to use this command displays the following error:
Error reading registry: 5

There is currently no mechanism for launching applications on the remote device using cordbg.  If you need this
support, Visual Studio .NET 2003 is your friend (it handles deployment and launching, and provides a pretty nice debugger interface to boot).

NetCF does not support viewing CPU registers.  Since we do not support displaying unmanaged stack traces or threads,
there is not much need here.  When you try to use this command, you get:
The current frame isn't a native frame!

This is the one that hurts the most.  Being able to set the instruction pointer during a debugging session is
a great way to investigate bugs.  Unfortunately, NetCF v1 does not support the setip command.  Any attempt to use setip results in:
SetIP returned 0x80004001.
Which translates into the COM error code E_NOTIMPL.

Why the last three are unsupported is pretty obvious -- cordbg states that these commands are for "Win32 mode only".

This should be the last of the backgrounder posts in this series.  Next we will start in with discussions about some of the commands which are supported.

-- DK

This posting is provided "AS IS" with no warranties, and confers no rights.

Skip to main content