"Petrus Wrang�" <[EMAIL PROTECTED]> wrote in message
news:20720@palm-dev-forum...
>
> Hi, I'm using CW R5 with SDK 3.0.

I thought that shared lib debugging was only available in CW6 and higher?
I've never used it therein though.

It's been a while so dementia may have set in, but last time I debugged into
interrupt code in a shared library on CW5, I had to make a monolithic build
of the shared library.  This basically entails making the dynamic library a
static library, and then it's very easy to debug using traditional the
traditional breakpoint system.  You make a monolithic build by using
#defines.  When #define MONO_BUILD, the "SYS_TRAP" in your lib's .h file
goes away:

#ifdef MONO_BUILD
   #define SYS_TRAP()
#endif

extern MSLErr MSLOpen ( UInt uRefNum )      SYS_TRAP ( sysLibTrapOpen );

This causes the precompiler to turn that line into an actual function call,
not a trap dispatch:
extern MSLErr MSLOpen(UInt uRefNum);

Assuming you are #including the proper files, this should result in a call
to MSLOpen() function, instead of a trap dispatch, which you can intercept
with a simple debugger breakpoint.

You also have to change your build settings such that the now-static-library
is linked into the rest of your code.  Again it's been a long while since I
toyed with this, but I hope that gets you up and running.  Email me offline
if not.

Oh, and I didn't have any luck debugging at an interrupt level on a PC.  I
think you have to use a Mac.  In my interrupt service routine, I threw a few
very breif DbgMsg()'s.  If you spend too much time in an ISR, you will crash
the OS in a very unpleasant manner, so breakpoints are out of the question I
think.

And since DbgMsg()'s send output through the serial port to the Mac debugger
which receives the messages, it's difficult debugging interrupts on the UART
since they're in use by the serial port.  Fun, fun, fun!!

-Jeff Ishaq




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to