Coding and remote debugging? - Windows Mobile Development and Hacking General

Hi,
what IDE do you use? I'm more interested in non-.net-programming (although I like C# very much), but I also have x86-ASM knowledge for instance. So what IDE is there for us "real" programmers?
When finally compiled... how do you test them? Is there some remote debug stub like in SoftICE, so that I can sit in front of my PC and step trough a program indeed running on my PDA (Magician)? If not, how to utilize the emulators provided by MS? Is there any inherent debugging capability?
So let's start this thread about professional programming 'n coding.

The only IDE you can use to debug native programs is eVC 4 or VS 2005 beta. There is a kernel-mode debugger in PlatformBuilder, but it requires a debug version of ROM (because debugger is really located inside ROM image).
There is a real emulator that can run ARM binaries. It comes with VS 2005. But currently it is very buggy.

On Microsoft's site, you can download eVC (embedded Visual C++) for free...and you can also download emulators for the Pocket PC for testing and debugging purposes.
I am not sure if these are the same emulators that mamaich is referring to (what does VS mean?)...but it's worth a try.

VS means Visual Studio. Version 2005 is currently in its beta phase, where beta2 is current. The problem is, where to get a debug version of my ROM? I thought it would simply imply installing some remote debug stub.
Good thing about eVC4 is, MS still cares about it (latest SP is from 7/23/2004). I think I'll give that a try until VS2005 becomes stable in terms of PPC.

Chatty said:
The problem is, where to get a debug version of my ROM?
Click to expand...
Click to collapse
In HTC or MS. In other terms - nowhere.
The only debug ROM that was leaked is WM2005 for Himalaya.

Ok, so I understand it like that: I cannot debug a program running on the hardware platform, only on the emulator.

Chatty said:
Ok, so I understand it like that: I cannot debug a program running on the hardware platform, only on the emulator.
Click to expand...
Click to collapse
Why? You can debug any program that is not in ROM. You cannot debug OS components.

The question is, where does the program run being single-stepped? And where does the debugger in control run? My favourite solution:
PPC: program being debugged
Desktop: debugger in charge

when you start the debugger you can choose between running it in the simulator or on the device
if when you run it on the device dident run on the device then the option would not be given
i guess[/i]

Chatty said:
PPC: program being debugged
Desktop: debugger in charge
Click to expand...
Click to collapse
I see that you even have not tried to install eVC and read its docs.

mamaich said:
I see that you even have not tried to install eVC and read its docs.
Click to expand...
Click to collapse
Is it possible to attach the debugger
to the remotely running process
(no source, no debug symbols),
stop it, single step, peek at the memory,
set a break at
an address, not a symbol ?

Related

.net 2005

http://lab.msdn.microsoft.com/vs2005/welcome/default.aspx
have anybody tried messing with the beta's to make pocketpc applications ?
Rudegar said:
http://lab.msdn.microsoft.com/vs2005/welcome/default.aspx
have anybody tried messing with the beta's to make pocketpc applications ?
Click to expand...
Click to collapse
I'm a MSDN subscriber and haven't received it yet. As soon as i get it will try to publish it somewhere in the net...
Cheers
well the link i gave will let you download the beta even if you dont subscriber to msdn
it does require a passport though
havent dl'd it myself though
infolink
Rudegar said:
well the link i gave will let you download the beta even if you dont subscriber to msdn
it does require a passport though
havent dl'd it myself though
Click to expand...
Click to collapse
I'm on my i-mate now & can't find any download links on that page. It is not even published at http://msdn.microsoft.com/downloads/recent.aspx download center.
Can you post a link to a pre-DL passport auth page?
http://lab.msdn.microsoft.com/express/visualc/
https://login.passport.net/ppsecure/uisecure.srf?id=42814
me
I'm using Visual Web Developer 2005 beta.
Completely new to web development.
HTML tags were completely beyond me as was data driving asp stuff.
BUT......
VWD is a dream to use.
I now have an asp site that lets XDA equiped engineers interface with our back office systems. The database integration is simple (tho there are a few bugs) and controls autosize for the target device.
Give it a go
well the only stuff relevant for me is c++ and maybe a bit of c# so i dont end up like some creepy dinosaur like those people who started coding Cobol back in the 70's and are still at it!
suppose one have to keep a bit up with the trend
VS 2005
Hi, there:
I'm using VS2005beta1, and I think its cool except a stupid bug on device application development. I attached some screen shots here. hope these information helpful.
Unlike evc+sdk developer tool set, vs2005 includes all stuff needed to build device applications, and it supports the latest emulator which running native ARM code on an emulated arm920 device, it's much faster than the legacy emulator, the legacy i486 emulator is still suported, check the attached platforms.jpg for supported platforms, notice wince 5.0 device is in the list. :lol:
now we can program in vb.net, c#, or c/c++. the attached screen shots show these different types of projects. convenient enough hur.
well, a big problem arised when develop in c/c++, i did not try vb.net and c# coz I don't like'em. when you create a new project, two platform configurations are created, one for device and the other for emulator. I mentioned the new emulator before, remember? its cpu is an arm920, check the screen shot. this emulator is used when deploy and debug for the project's emulator configuration. but unfortunately, under the emulator configuration, the compile and linker will generate x86 executable which cannot be run on the target emulator. what is worse is that you cannot change to use legacy i486 emulator, you can not even connect to the legacy emulator, the problem may related to the virtual machine network service driver installed by the emulator installation file. I'm still checking it. until this problem is solved can we finally debug on emulator, otherwise we had the only choice to debug on the device, btw I can debug on device with no problem, it can even attach to a running process on the device
at the predicatable future, vs2005 will certainly supercede evc+sdk to become the unified development platform.
why the screen shots appear in a reverse order of my attaching? I think it should be a list instead of a stack. :roll:
Well, I think I´ll have a look at it soon. Could you check if there are any project types for deployment? Means a "setup projekt" for devices?
yeah, I forgot this one, check the shot, it support device cab project.

Getting Started - Which Development Tools?

I'm sure I can learn a lot of this at microsoft.com --
Which compiler and add-ons do you install to get started with writing apps in VB and VC?
Are the only tools VB.Net and VC# ?
Phoney said:
I'm sure I can learn a lot of this at microsoft.com --
Which compiler and add-ons do you install to get started with writing apps in VB and VC?
Are the only tools VB.Net and VC# ?
Click to expand...
Click to collapse
You should forget .NET under Pocket PC...it is painfully slow. The only option is C++, which for you can use either the free Embedded Visual C++ 4, or Visual Studio 2005.
Thanks!
And does this mean that I should forget about using Visual Basic for anything as well?
Phoney said:
Thanks!
And does this mean that I should forget about using Visual Basic for anything as well?
Click to expand...
Click to collapse
Indeed... eVB is not supported on WM5 anyways (at least not officially...and eVB is not too powerful either).
Agree with KTamas! For now, VS2005 is the BEST tool perhaps.
is ws2005 also mfc and win32 stk or only .net like 2003 was ?
Hi Rudegar!
VS2005 works with MFC and Win32 for both PC and mobile devices. It also claims to support WM2003 SDKs but I was unable to compile an exe with it that would run on a 2003 device (although I tried adding WM2003 SDK to an existing WM5 project so maybe I just go the settings wrong)
Yes, vs2005 do support pure WIN32 programming in WM2003, I wrote two or more app for PPC-6600, it works fine.
Isn't C# compiled during first execution (it takes time, so startup is long) and then it's as fast as C++?
Marx2 said:
Isn't C# compiled during first execution (it takes time, so startup is long) and then it's as fast as C++?
Click to expand...
Click to collapse
No. It starts up slowly cause it has to load the Compact Framework into the memory. .NET (therefore C# included) apps are compiled while they are running, they are running on a JIT-compiler (Just-in-Time).
Instead of MFC, I recommend using the Windows Template Library (WTL) -- it's a set of C++ template classes for Windows UI elements, and is CE-friendly. I've used it on big Windows for many years; IMHO it's much better than MFC.
Isn't effect of JIT compiler cached?
I think JVM can do that. There is also an option to compile permamentaly to exe (this lacks portability)

Beginner's pointers?

Hi chaps,
I've just got myself an O2 XDA Orbit - great device, and now I'm looking for developing for it - just simple things at first, like a Blackjack game, or a simple Today feature with the sun and moon times on it; this sort of thing.
I've got Visual Studio .NET 2003, but I see that in order to program the latest devices, you need VS 2005 (?). So, I've downloaded Embedded Visual Studio C++ v4 with all the SDK's and I'm hoping to develop for an earlier version of Windows Mobile, and hope that it works.
So while I've got all that, I'm now stuck as to where to start! Can anyone point me to a good book, or something online which will help me through a simple CE application? How you do get the Today screen working, for example? I realise that this might be asking a lot, but a couple of pointers would be great - if you could!
Many thanks,
MrP.
I'm just starting out myself with windows mobile programming. You can find a lot of info from msdn. Here is an example Hello app.
http://msdn2.microsoft.com/en-us/library/ms912017.aspx
You can find a lot of good stuff at the code project site also.
http://www.codeproject.com/ce/
eVC has wizards that will get you going. One thing I found out about using eVC is that you won't be able to debug your programs on a WM5/6 device since the SDK's are not compatible with them. It can be a bit of a challenge to fix bugs without a debugger. I can't get the debugger to work with the emulator either for some reason.
A question for other eVC developers out there. Is it possible to use the emulator to debug programs or do you all have an old PPC2003 device that you use to do your debugging? Or have you all moved on to VS2005?
I've bought visual studio 2005 standard and it is great - it fully supports WM5/6 (with sdk) and runtime debugging - for .exe it works well but I have problems with .dll - I can't debug dll files - does anyone know how to make it?
Pleas look up threads started by vijay555.
He wrote a comprehensive article on the tools and possibilities to begin developing for these devices.
Just as a quick side note:
There is no need what so ever to pay M$ money for VS 2005 if you want to develop in C / C++.
Apps written in eVC++ 4 will work perfectly with WM 5 and 6 and if you need any missing API (not many of those) you have 2 choices:
1) Manually unpack the SDK and link to it.
2) Use implicit linking (that LoadLibrary and GetProcAdress).
levenum said:
Pleas look up threads started by vijay555.
He wrote a comprehensive article on the tools and possibilities to begin developing for these devices.
Just as a quick side note:
There is no need what so ever to pay M$ money for VS 2005 if you want to develop in C / C++.
Apps written in eVC++ 4 will work perfectly with WM 5 and 6 and if you need any missing API (not many of those) you have 2 choices:
1) Manually unpack the SDK and link to it.
2) Use implicit linking (that LoadLibrary and GetProcAdress).
Click to expand...
Click to collapse
Sorry about the delay in replying...
Many thanks for the pointers.. Just a matter of starting now!

Need a c/c++ compiler !

hello guys,
i have been trying to figure out a way to do some c or c+ programming on the go, i have a desktop replacement laptop and i dont wanna have to carry it with me with all of my other books to school everyday. i am tryin to find a c++ compiler (hopefully gui)
i have tried
pocket gcc (installed but doesnt work)
pocketc (needs a translator to work)
evc++ (apparantly either i downloaded the desktop version or this is not what i was looking for)
i am just looking to do some c or c++ coding without a laptop at school.
thanks in advance.
joe
gcc works maybe you just set it up wrong
if you can do with c# then there is a c# compiler that runs on pocketpc
it dont have a gui though but any notepad'ish program can edit those files
otherwise there is this
http://www.pocketgear.com/software_detail.asp?id=5723
but it's not a fullblown compiler imho
never seen other real compilers or development envioments for pocketpc's
think the demand is TINY!
Yeah, Pocket GCC has worked successfully for me in the past.
However, I used Mamaich's version, and this was on a WM2003 device. You need to find a compatible Console output first for WM5 (you're using the Hermes right?). I can't remember if we found a good one for >= WM5.
There's various Basic type programming languages as well for native device development, and PocketC, but that's very very old.
V
How about C#....
Hi,
Ig you can bare using C# instead, I've just posted above about a free tool I created called "C# IDE Mobile" which allows writing/executing C# compact framework applications directly on the PPC.... But if you need C, then this won't help.
Harvey
Actually i have updated to wm6 and i am not sure if that is the reason cmd program from gcc wont work in it. I cant even find any sort of manual for it either.
and yes i do need a c compiler because from next semester i am startin to take unix courses and its mostly c programming. and if i get an idea in the middle of history class i might want to try it out on the phone instead of lappy.
so does anyone else have any ideas about a non translating program for c or c++
i was wondering if evc++ was only for PC and not PPC's cause i couldnt find a non xp version.
so i guess no compiler's huh?
evc++ is a IDE for windows which enable people to make pocketpc applications
not to run on the ppc
for the most parts the syntax of c# even java too is the same as
with c
so if all you need to do is make different algoritmes then you can use those
or the vi editor i linked too
if wm6 have the same issue with cmd as wm5 then this thread may help
http://forum.xda-developers.com/showthread.php?t=255114
does someone have a success with Tiny C compiler for ARM (tcc-arm) ?
IMHO, it would be quite handy for on-pocket development
I'm not sure if you can develop PocketPC-Applications with this, but I think its possible.
Try Visual Studio Express (C++-Edition) combined with the Windows Mobile SDK and the Windows Mobile Emulator Images.
All free, all available @ Microsoft Download Center. It's not tiny, but it's GUI and you can extend the pure C++-Development Environment with the ability to develop mobile applications and even to test them on Emulator.
Personally I'm developin mobile .NET Applications with Visual Studio Professional + Windows Mobile SDK and Windows Mobile Emulator. Works fine.
DennisMoore,
TCC is great due to its small size. And the reason why I'm interested in TCC is ability to cross-compile it to make it usable not only for ppc development, but for development on ppc. GCC is too huge application
try searching Bloodshed Dev-C++
I tried PocketDOS and TurboC++
Some time ago I was looking for this same thing and as I was just trying to do small DOS application (educational) then my best option was TurboC++ running in Pocket DOS. It can be changed to other pocket pc DOS emulator (there is a freeware one)/DOS C compiler.
pgcc should work
vijay555 said:
Yeah, Pocket GCC has worked successfully for me in the past.
However, I used Mamaich's version, and this was on a WM2003 device. You need to find a compatible Console output first for WM5 (you're using the Hermes right?). I can't remember if we found a good one for >= WM5.
There's various Basic type programming languages as well for native device development, and PocketC, but that's very very old.
V
Click to expand...
Click to collapse
I have this installed on my WM6 device and it works fine. In order to make the console work, you have to make a change in the registry.
see
http://forum.xda-developers.com/showthread.php?t=275019&highlight=console
Is this thread still active?
I use PGCC on my T-mobile Dash. I basically have to use batch files named without the following keys: W, E, R, S, D, F, X, C, V, which correspond to 1-9 on the dial pad. For example a file named run.bat would show up as 3un.bat so I would have to name it as such. I was attempting at one time to remap the keyboard to the HTC Excalibur like PocketDOS but, it was out of my experience level. I created a console pack from several different files that I modified. I had to jump through some hoops to discover this but, it's half the fun.
vijay555 said:
Yeah, Pocket GCC has worked successfully for me in the past.
However, I used Mamaich's version, and this was on a WM2003 device. You need to find a compatible Console output first for WM5 (you're using the Hermes right?). I can't remember if we found a good one for >= WM5.
There's various Basic type programming languages as well for native device development, and PocketC, but that's very very old.
V
Click to expand...
Click to collapse
Here's another console, tried it on WM6.1 and works like a charm.
http://forum.xda-developers.com/showpost.php?p=1854003&postcount=28
As for pocket GCC, i remember that it had some problems if file paths passed to it contained any spaces, so "/storage card" was a bit of a problem, and obviously, putting it in device's memory isn't even possible on many current pda's. The solution i came up with was renaming "/Storage card" to something wothout spaces (like "/SD").
You can do it by a simple registry edit the key:
Code:
HKLM/System/Storage Manager/Profiles/SDMemory/Folder
or
HKLM/System/Storage Manager/Profiles/SDMMC/Folder
(i don't remember which one it was, so you'll have to do some experimenting)
to anything you would like. After a soft reset you'll see the storage card mounted to a different folder.

How to Develop Cross Platform Binaries ( to run on PC and PDA) ?

Recently, i came across a binary file that ran on PC as well as Pocket PC. i cant quite get myself to recollect where i saw, but i do remember something like a 'pure .net' application.
i was wondering if someone could point me to a place where i could get more information about development of such a application.
Thanks
As you may know, PPC Binaries are ARM based (most of the time) and PC binaries are X86 code, so it shouldn't be possible to easily swap from one to the other.
BTW, .Net binaries (which differs from real binaries) are intended to run on whatever plateform, as long as there is a Common Language Runtime accessible.
So an application designed for the .Net Compact Framework should be able to run on the .Net Framework under Windows (with MSIL Code) .
'Hello world' application?
so could you possible send in a 'Hello world!' application of some sorts.. ?
foxenesys said:
So an application designed for the .Net Compact Framework should be able to run on the .Net Framework under Windows (with MSIL Code) .
Click to expand...
Click to collapse
Confirmed. I did it.
However, I was unable to do it again recently. Maybe the application I succesfully wrote and ran on both the PC and the PPC was made using the .NET Compact Framework v1, while the applications I write actually use the v2.
Lieutenant said:
Confirmed. I did it.
Click to expand...
Click to collapse
what project was it? what did the application actually do? how was it developed??
Here's some information: http://msdn.microsoft.com/msdnmag/issues/07/07/ShareCode/default.aspx
The app was indeed likely a .NET (Compact) application, it will run on any device that has the .NET Compact framework installed (most older phones have v1 (WM5), my Kaiser has v2 installed(WM6)). Note that if you start writing like that, you will most likely be writing for v2, and for a large number of PPC that means the user will also still have to install .NET Compact Framework v2 which may take up to 25mb.
Though the idea behind .NET is nice, and on PC's there's hardly a noticable different between a natively compiled application and a .NET application, on a PPC you do really notice the difference. The .NET apps are very noticable slower in operation and slower in load and take more memory than the natively compiled apps. On the other hand, they usually are only a few KB in size, but that's because all the magic happens in the .NET Compact Framework which is a seperate install (comes preloaded with WM6).
Also, when developing with .NET Compact Framework I have also noticed it is very limited, compared to the normal .NET Framework, and even more limited compared to native applications.
Personally, I use the FreePascal compiler (which can create binaries for pretty much every platform out there, from Windows to Linux to Windows Mobile to Nintendo DS)
Chainfire said:
Personally, I use the FreePascal compiler (which can create binaries for pretty much every platform out there, from Windows to Linux to Windows Mobile to Nintendo DS)
Click to expand...
Click to collapse
But it wont compile a same binary file that will run on x86 architecture and ARM architecture will it..?
what i had in mind was a application when run on my PDA will act as a normal application and when the same file was opened on my desktop computer will run like a normal win32 application, without throwing the '... not a valid Win32 application' error.
tomjan said:
But it wont compile a same binary file that will run on x86 architecture and ARM architecture will it..?
what i had in mind was a application when run on my PDA will act as a normal application and when the same file was opened on my desktop computer will run like a normal win32 application, without throwing the '... not a valid Win32 application' error.
Click to expand...
Click to collapse
Indeed you would need two different executables for it my way, but IMHO compared to your slower, less responsive and more limited version that only needs one executable it is still a much better option.
Chainfire said:
Indeed you would need two different executables for it my way, but IMHO compared to your slower, less responsive and more limited version that only needs one executable it is still a much better option.
Click to expand...
Click to collapse
Peace...
the point is, there could be scenarios where a cross platform application could be helpful even though it might suffer from serious perfromance issues.
like offhandedly, if you consider PIMBackup application, if if had the ability to display the backedup file on your PDA and your PC, viola.. the phone could act like a 'Portable' outlook, with no requirement of active sync to be installed.
all said and done.. this is no an argument about native vs. .net, because i have NO experience at all with mobile application development. just thought it was cool to be able to run a a same file on two entirely different architectures / platforms / blah blah...
Thanks
Rhapsody said:
Here's some information: http://msdn.microsoft.com/msdnmag/issues/07/07/ShareCode/default.aspx
Click to expand...
Click to collapse
Thanks Rhapsody, this should keep me occupied for some time.

Categories

Resources