Discussion:
Can't attach to process on CE device
(too old to reply)
minorguy
2005-10-19 20:02:10 UTC
Permalink
I'm using eMbedded VC++ 4.0 with SP4. I'm trying to attach to a
process on the target device by selecting Build-->Start Debug-->Attach
to WCE Process. When I do this, I get a message box with the error
"Toolhelp.dll cannot be copied to the target device."


I am using Platform Builder 5.0 to build an image for my CEPC device,
the target device. I've included toolhelp.dll in the image. I've also
included the platform manager files needed for debugging over ethernet:
cemgrc.exe, tcpipc.dll and cetlkitl.dll. I use Platform Builder to
download the image to the CEPC. (I've worked around the problem of
cemgrc.exe exiting by writing a little app to ensure cemgrc.exe is
always running)

Then I go to eMbedded VC++ which is on a separate system. The program
I'm developing is a device driver. I can connect and download my DLL
to the target CE system OK over ethernet. I can use all the remote
tools OK, such as the process viewer and registry editor. But when I
select Attach to WCE Process, it tells me that "Toolhelp.dll cannot
be copied to the target device."

I've ensured that toolhelp.dll does exist on the target device. So I
don't know why eMbedded VC++ thinks it needs to download it. Although
the toolhelp.dll file is read-only on the target device---and it
won't seem to allow me to change that---I don't think that's the
problem. I got the same error even before I had built toolhelp.dll into
the CE image.

Any ideas on how I can fix this and attach to remote processes? I need
to attach to device.exe so I can debug my driver DLL as it gets loaded.

I did a search and only found one other person who had this same
problem and there were no replies. (
http://groups.google.com/group/microsoft.public.windowsce.embedded.vc/browse_frm/thread/13dcf7f410bdf2a4/005c6273f4b9d7b4?lnk=st&q=toolhelp.dll+cannot+be+copied+to+the+target+device&rnum=1#005c6273f4b9d7b4
)

Thanks.
Dan McCarty
2005-10-21 15:12:15 UTC
Permalink
Are you using the standard SDK or a custom SDK? Toolhelp.dll is part
of the kernel debugger, so if your SDK wasn't built with the "Enable
Kernel Debugger" option checked, you'll probably have problems trying
to use it. (Even if you manually included the file.)

On my emulator toolhelp.dll is present in the \windows directory, and
it isn't read-only. When I try to attach to a running process with eVC
I get a message about not being able to find commdlg.dll, but I can
cancel past it.

BTW, attach to running process is a better way to debug in eVC. I
wrote a post about it a little while back.
("http://groups.google.com/group/microsoft.public.windowsce.embedded.vc/msg/f557199d4b5b7eff?dmode=source)

Hope part of my rambling helped,
Dan.
Post by minorguy
I'm using eMbedded VC++ 4.0 with SP4. I'm trying to attach to a
process on the target device by selecting Build-->Start Debug-->Attach
to WCE Process. When I do this, I get a message box with the error
"Toolhelp.dll cannot be copied to the target device."
I am using Platform Builder 5.0 to build an image for my CEPC device,
the target device. I've included toolhelp.dll in the image. I've also
cemgrc.exe, tcpipc.dll and cetlkitl.dll. I use Platform Builder to
download the image to the CEPC. (I've worked around the problem of
cemgrc.exe exiting by writing a little app to ensure cemgrc.exe is
always running)
Then I go to eMbedded VC++ which is on a separate system. The program
I'm developing is a device driver. I can connect and download my DLL
to the target CE system OK over ethernet. I can use all the remote
tools OK, such as the process viewer and registry editor. But when I
select Attach to WCE Process, it tells me that "Toolhelp.dll cannot
be copied to the target device."
I've ensured that toolhelp.dll does exist on the target device. So I
don't know why eMbedded VC++ thinks it needs to download it. Although
the toolhelp.dll file is read-only on the target device---and it
won't seem to allow me to change that---I don't think that's the
problem. I got the same error even before I had built toolhelp.dll into
the CE image.
Any ideas on how I can fix this and attach to remote processes? I need
to attach to device.exe so I can debug my driver DLL as it gets loaded.
I did a search and only found one other person who had this same
problem and there were no replies. (
http://groups.google.com/group/microsoft.public.windowsce.embedded.vc/browse_frm/thread/13dcf7f410bdf2a4/005c6273f4b9d7b4?lnk=st&q=toolhelp.dll+cannot+be+copied+to+the+target+device&rnum=1#005c6273f4b9d7b4
)
Thanks.
Paul G. Tobey [eMVP]
2005-10-21 15:56:03 UTC
Permalink
Although you may get the toolhelp DLL when you enable kernel debugger, you
don't have to enable kernel debugging to get it. It's in the catalog in the
Core OS section under Debugging Tools (or something about like that).

Paul T.
Post by Dan McCarty
Are you using the standard SDK or a custom SDK? Toolhelp.dll is part
of the kernel debugger, so if your SDK wasn't built with the "Enable
Kernel Debugger" option checked, you'll probably have problems trying
to use it. (Even if you manually included the file.)
On my emulator toolhelp.dll is present in the \windows directory, and
it isn't read-only. When I try to attach to a running process with eVC
I get a message about not being able to find commdlg.dll, but I can
cancel past it.
BTW, attach to running process is a better way to debug in eVC. I
wrote a post about it a little while back.
("http://groups.google.com/group/microsoft.public.windowsce.embedded.vc/msg/f557199d4b5b7eff?dmode=source)
Hope part of my rambling helped,
Dan.
Post by minorguy
I'm using eMbedded VC++ 4.0 with SP4. I'm trying to attach to a
process on the target device by selecting Build-->Start Debug-->Attach
to WCE Process. When I do this, I get a message box with the error
"Toolhelp.dll cannot be copied to the target device."
I am using Platform Builder 5.0 to build an image for my CEPC device,
the target device. I've included toolhelp.dll in the image. I've also
cemgrc.exe, tcpipc.dll and cetlkitl.dll. I use Platform Builder to
download the image to the CEPC. (I've worked around the problem of
cemgrc.exe exiting by writing a little app to ensure cemgrc.exe is
always running)
Then I go to eMbedded VC++ which is on a separate system. The program
I'm developing is a device driver. I can connect and download my DLL
to the target CE system OK over ethernet. I can use all the remote
tools OK, such as the process viewer and registry editor. But when I
select Attach to WCE Process, it tells me that "Toolhelp.dll cannot
be copied to the target device."
I've ensured that toolhelp.dll does exist on the target device. So I
don't know why eMbedded VC++ thinks it needs to download it. Although
the toolhelp.dll file is read-only on the target device---and it
won't seem to allow me to change that---I don't think that's the
problem. I got the same error even before I had built toolhelp.dll into
the CE image.
Any ideas on how I can fix this and attach to remote processes? I need
to attach to device.exe so I can debug my driver DLL as it gets loaded.
I did a search and only found one other person who had this same
problem and there were no replies. (
http://groups.google.com/group/microsoft.public.windowsce.embedded.vc/browse_frm/thread/13dcf7f410bdf2a4/005c6273f4b9d7b4?lnk=st&q=toolhelp.dll+cannot+be+copied+to+the+target+device&rnum=1#005c6273f4b9d7b4
)
Thanks.
Dan McCarty
2005-10-21 16:20:53 UTC
Permalink
Post by Paul G. Tobey [eMVP]
Although you may get the toolhelp DLL when you enable kernel debugger, you
don't have to enable kernel debugging to get it. It's in the catalog in the
Core OS section under Debugging Tools (or something about like that).
I stand corrected. Thanks.

-Dan
minorguy
2005-10-21 20:10:33 UTC
Permalink
Thank you very much for the replies. Unfortunately I'm still stuck.

I included toolhelp.dll by way of including Debugging Tools, as Paul
pointed out. Anyway, the problem persists whether the "Enable Kernel
Debugger" option is checked or not. I'm using a custom SDK. I've
built my own OSDesign based in Platform Builder based on one of the
templates. Then I exported the SDK and I use that in eMbedded VC++.

I can't use the emulator because I'm developing a client driver for
a USB device. I need to access the device.

My toolhelp.dll file is normally read-only and I can't change it. But
one time I did boot up and it was not read-only for some reason. So I
tried to delete it and I did. But I saw some strange behavior. The
toolhelp.dll file went to the recycle bin, but when I hit F5, it also
reappeared in the \Windows directory again. I'm new to WinCE so for
all I know maybe that's normal. Anyway, none of this seemed to help
at the time. Now, toolhelp.dll has gone back to being read-only and I
don't know why it was writeable that one time.

I started to think that toolhelp.dll is being held by the Platform
Builder debugger somehow. So far, the only way I've been able to run
my nk.bin image on the CEPC device is to boot the device with a floppy
and then download the image from Platform Builder. I figured that maybe
I need to get Platform Builder out of the picture. But simply stopping
the PB debugger and detaching didn't help. So then I wanted to try
booting directly to the nk.bin image, but I haven't been able to do
that yet. Since the image won't fit onto a floppy, I need to boot
either from a CD or hard disk. I tried making a bootable CD that's
equivalent to the floppy except that it includes nk.bin on it as well.
But for some reason, the nk.bin file is not visible when booting to
MSDOS 6.22 and I don't know why. And if I type "loadcepc /v
nk.bin" I get the error that the file is not found. I don't know if
booting from hard disk will be any better, but I'm going to try that
next, after I reformat from NTFS to FAT.

But it all seems rather odd. If eVC++ is going to try to download
toolhelp.dll, then why is it said that toolhelp.dll needs to be on the
target system? Or if it's already there, why is eVC++ trying to
download it?

I did come across the following note in a readme file for eVC++ SP2 QFE
5308:

---------------------------------------------------
Error Messages:

If you get the error message regarding 'File not found' or files
not copied, the possible reason is that a specific processor files are
not originally installed on the machine and hence could not be updated.


You will also get the File could not be copied error if a newer version
of the file already exists on your machine or the file was in use by
another process and could not be copied over.
----------------------------------------------------

Maybe that's obsolete since I'm using SP4. Anyway, I think the
toolhelp.dll file on the target system is the same one it's trying to
download. The date and time of the one on the target system matches the
one I found in C:\Program Files\Common Files\Microsoft Shared\Windows
CE Tools\Platman\target\wce500\x86\. (07/06/2004 12:39) So there
shouldn't be any conflict as far as that's concerned.

Still plugging away.
maxx
2013-08-23 10:30:35 UTC
Permalink
minorguy wrote on 10/19/2005 16:02 ET
Post by minorguy
I'm using eMbedded VC++ 4.0 with SP4. I'm trying to attach to
process on the target device by selecting Build-->Start Debug-->Attac
to WCE Process. When I do this, I get a message box with the erro
"Toolhelp.dll cannot be copied to the target device.
I am using Platform Builder 5.0 to build an image for my CEPC device
the target device. I've included toolhelp.dll in the image. I've als
included the platform manager files needed for debugging over ethernet
cemgrc.exe, tcpipc.dll and cetlkitl.dll. I use Platform Builder t
download the image to the CEPC. (I've worked around the problem o
cemgrc.exe exiting by writing a little app to ensure cemgrc.exe i
always running
Then I go to eMbedded VC++ which is on a separate system. The progra
I'm developing is a device driver. I can connect and download my DL
to the target CE system OK over ethernet. I can use all the remot
tools OK, such as the process viewer and registry editor. But when
select Attach to WCE Process, it tells me that "Toolhelp.dll canno
be copied to the target device.
I've ensured that toolhelp.dll does exist on the target device. So
don't know why eMbedded VC++ thinks it needs to download it. Althoug
the toolhelp.dll file is read-only on the target deviceand i
won't seem to allow me to change thatI don't think that's th
problem. I got the same error even before I had built toolhelp.dll int
the CE image
Any ideas on how I can fix this and attach to remote processes? I nee
to attach to device.exe so I can debug my driver DLL as it gets loaded
I did a search and only found one other person who had this sam
problem and there were no replies.
http://groups.google.com/group/microsoft.public.windowsce.embedded.vc/browse_frm/thread/13dcf7f410bdf2a4/005c6273f4b9d7b4?lnk=st&q=toolhelp.dll+cannot+be+copied+to+the+target+device&rnum=1#005c6273f4b9d7b
Post by minorguy
Thanks
I exactely have the same problem
My target is a x86 CEPC. I use an ISA ethernet NE2000 compatible card. Th
system is booting from a CF Card

Windows CE 4.2 (Updates installed
eVC++4.
Download through plateform builder works
Remote tools works
Debugging with F5 for a .exe works

I run cemgrc.exe manually (cemgrc.exe /S /T:TCPIPC.dll /Q /D:@ip:port)
I'm developping a windows ce service (which is a dll) so I need to attach t
service.exe to debug it

I've made a step more than the post before
The NK.bin image is natively on the CF card. I don't use PB to download it o
the target. PB is never connected to the target

Maybe someone have THE solution :). If I find it, i'll post it.
maxx
2013-08-23 15:16:44 UTC
Permalink
minorguy wrote on 10/19/2005 16:02 ET
Post by minorguy
I'm using eMbedded VC++ 4.0 with SP4. I'm trying to attach to
process on the target device by selecting Build-->Start Debug-->Attac
to WCE Process. When I do this, I get a message box with the erro
"Toolhelp.dll cannot be copied to the target device.
I am using Platform Builder 5.0 to build an image for my CEPC device
the target device. I've included toolhelp.dll in the image. I've als
included the platform manager files needed for debugging over ethernet
cemgrc.exe, tcpipc.dll and cetlkitl.dll. I use Platform Builder t
download the image to the CEPC. (I've worked around the problem o
cemgrc.exe exiting by writing a little app to ensure cemgrc.exe i
always running
Then I go to eMbedded VC++ which is on a separate system. The progra
I'm developing is a device driver. I can connect and download my DL
to the target CE system OK over ethernet. I can use all the remot
tools OK, such as the process viewer and registry editor. But when
select Attach to WCE Process, it tells me that "Toolhelp.dll canno
be copied to the target device.
I've ensured that toolhelp.dll does exist on the target device. So
don't know why eMbedded VC++ thinks it needs to download it. Althoug
the toolhelp.dll file is read-only on the target deviceand i
won't seem to allow me to change thatI don't think that's th
problem. I got the same error even before I had built toolhelp.dll int
the CE image
Any ideas on how I can fix this and attach to remote processes? I nee
to attach to device.exe so I can debug my driver DLL as it gets loaded
I did a search and only found one other person who had this sam
problem and there were no replies.
http://groups.google.com/group/microsoft.public.windowsce.embedded.vc/browse_frm/thread/13dcf7f410bdf2a4/005c6273f4b9d7b4?lnk=st&q=toolhelp.dll+cannot+be+copied+to+the+target+device&rnum=1#005c6273f4b9d7b
Post by minorguy
Thanks
Ok I finally get a solution

My OS image was including ToolHelp API. So the toolhelp.dll located in /Window
was considered in ROM. That can explain why evC++ was unable to copy/overwrit
it
I've modified my OS image by kicking out the debug API. To have debug tool
available, I've copied all the content of the folder C:/ProgramFiles/Commo
Files/Microsoft shared/Windows CE Tools/platman/target/wce420/x86 (as my targe
is x86 based) to the target. That folder contains all the file needed to debu
including toolhelp.dll
On my target, i have a .bat that copy all these file from the CF card to th
/Windows directory

But that was not sufficient. I still had that error "toolhelp.dll can no
be copied to target device" :

I started to believe that comes from my PC. So I looked for updates

My eVC++ 4.0 was with a SP2 (4.00.0714.0)... You can download the SP4 here
http://www.microsoft.com/en-us/download/details.aspx?id=1668

I installed it, and then, it worked! :D My eVC++ is now 4.00.1610.0

I've also tried with the wce500 tools (as they're added with sp4) but tha
doesn't worked (timeout)

After that, I tried again with an OS image that included the ToolHelp API, an
that worked too. I missunderstand that..

Hope that it will help someone... one day... ;)

Loading...