> Note there's no way to debug beaming to a device that is currently NOT
>running your app.
Actually, there is. PalmDebugger can come in extremely handy in unusual
situations like this.
A few times I've needed to do this sort of thing. I took advantage of the
fact that when beaming something, the entire beam operation takes place
before the data is given to the app. So then at the "Do you want to
receive this?" message, you just have to break into the debugger and then
be able to debug at the assembly level :-)
Breaking into the debugger like this is also sort of a trick and not
supported. But there's a magic byte in low memory which is extremely
useful.
Actually, I already wrote up a description of this for this forum... ah,
here it is:
In current versions of Palm OS software (i.e. 3.0 through 3.5, possibly in
2.0), there's an unsupported magic global variable at location 0x101, which
you can set to 0x81. If that value is there, then pressing the HotSync
button on the cradle will cause a debugger trap. Therefore you can connect
with PalmDebugger and set an appropriate breakpoint where you really want
it, and walk through that way.
Now to make things more complicated, you can't set that 0x81 value with the
debugger, otherwise you can't do the actual beam because the serial port is
open. So I wrote a trivial prc which wrote the value and exited. Thus my
debugging steps were this:
- install new software and reboot
- run the app which wrote 0x81 to location 0x101
- beam the data from the other device to the target
- while the "do you want to receive this" dialog is up, hit the HotSync
button to drop into the debugger
- set a breakpoint (atr "whatever" or br 0xWhatever)
- hit "g"
- use the UI to accept the beam so the system starts your code running, and
eventually hits the breakpoint you set
- debug with PalmDebugger
- repeat until the bug is found!
So this trick isn't guaranteed to work, to continue working, to ever have
worked, to be safe for public consumption, or anything else like that. But
I've occasionally found it handy. Hope you will too.
-David Fedor
Palm Developer Support
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/