On Fri, Aug 03, 2001 at 01:59:28AM -0700, Phil wrote:
> When one uses the normal gnu gdb for debugging in c,
> you can execute many c commands with print such as
> print strlen(x)
[...]
> However I can't do this so far using the palm gnu
> version, even when I try to use the palm replacement
> string functions in this case...it tries to recognize
> the command as a variable or some such.  

Palm OS API functions such as StrLen() are not linked into your
application like normal functions, but are called via special system
trap sequences.  When you tell m68k-palmos-gdb to "print StrLen(x)", it
says "no such symbol StrLen" because there really isn't sufficient StrLen
symbolic information available to it.  Furthermore, GDB couldn't call it
anyway because it doesn't know how to use the system trap sequence.

You need to limit yourself to calling from GDB only normal functions
which are linked into your application.  If you really need to print
the output from StrLen, you need to supply a normal function in your
application which does the same job:

        int myStrLen (const char *s) { return StrLen (s); }

However, if you do this and type "print myStrLen(x)" you'll discover
two things:

* Calling functions from GDB uses some of GDB's Palm OS communication
  routines that are so infrequently used that they still output lots of
  debugging information that noone's ever bothered to remove. :-)

* Modern Posers complain about the trap instruction that m68k-palmos-gdb
  uses to regain control after calling the function (I'm oversummarizing
  here).

Since the Poser alerts are ones that don't have continue buttons, you're
out of luck doing this while debugging against the emulator.  It works
fine when debugging against a real device.  IMHO this is (mostly) a bug
in Poser, and I've posted further details about it on emulator-forum.

    John

-- 
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