Hi,

> Is there a document someplace that describes a way to debug a card 
> applet? I've got a nasty bug in one, and the emulator we have is for 
> IBM/Phillips smartcards and the bug is in a Schlumberger card.
>
> Any comments would be appreciated.
The advantage of Java Card is the "write once, run anywhere" and also if the applet 
works on 
Java Card from IBM, it may work on Java Card from Axalto (the new name of 
SchlumbergerSema) except on specific parts such as cryptographic algorithm 
implementations. 
Else you can use method similar to the "printf" method on the C language (on the PC) 
using the 
ISOException.throwIt(short sw) method in your Java code to detect where is located 
your 
problem.

For instance, put ISOException.throwIt((short) 0x6666) at the beginning where you 
suspect 
there is the bug. Compile/convert/load/install the applet. Start the execution ... and 
if you obtain 
SW=6666 the bug is after the position of the ISOException.throwIt, else the bug is 
before its 
position.
Then delete the applet/package, move the ISOException.throwIt((short) 0x6666) and do 
the 
step above.

Note that you can use ISOException to return the value of variable as SW.

This method is not clean but it may help you.
You can also used the I/O methods sending the APDU response by piece but it is more 
complex.

Regards,
--
Damien Sauveron



-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
_______________________________________________
Muscle mailing list
[EMAIL PROTECTED]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to