July 2007 Archives
CVM's VM Inspector
Posted by mlam on July 31, 2007 at 11:59 PM | Permalink
| Comments (1)
In a previous blog entry, I showed you a map of CVM. If you are a VM engineer (or someone who is doing a port of the VM), and need to do some debugging, navigating all that data structures can be pretty daunting. How do the CVM engineers do it?
History
Since the very early days, CVM was built with a bunch of utility functions that allows us to dump certain information about certain commonly used VM data structures. For example, 2 very popular examples of these are:
1. CVMconsolePrintf(), and
2. CVMdumpStack()
CVMconsolePrintf() is just like printf except that it adds some nice formating options like %O, %C, %M, %F, that prints the details of a CVMObject *, CVMClassBlock *, CVMMethodBlock *, and CVMFieldBlock * respectively. There is more, but this gives you the idea. CVMdumpStack() is used to dump the contents of the Java stack. The CVM engineers would call these utility functions from the gdb command prompt at runtime to get live information about the state of the VM and its data structures.
However, there is a problem with using these utility functions. That is, you will need to be careful how you use them. For example, if you use CVMconsolePrintf("%C", ...) with a pointer that is a CVMClassBlock *, then you may inadvertantly cause a segfault that will crash the VM. And this would mean that you could lose all the debugging state of the bug that you have spent hours or days to reproduce.
Can't we just get the VM utilities to just do all the careful checks for us automatically so that we don't make a foll of ourselves by calling the wrong call at the wrong time?
the VM Inspector
Why, yes we can ...
Continue Reading...
CDC and JVMTI
Posted by mlam on July 30, 2007 at 10:45 PM | Permalink
| Comments (8)
In a comment in a previous blog entry, a friend asked a question about using the JVMTM Tools Interface (JVMTI) with JavaME CDC ...
... I am considering to use JVMTI instead of JVMPI. However, I have one concern that does JVMTI applicable to CDC 1.1(HI)?
As you know, CDC 1.1 is based on JavaSE 1.4, but JVMTI is based on JavaSE 1.5.
Kind regards
Byungseon Shin
Here's what I think ...
Continue Reading...
|