>> The next thing I would like to have is a method to get the calling
>> method name. This would be good for logging.
>
> You could create a Throwable() object and then get the StackFrame[].
>
That is what the logging API currently does. But that's terrribly
inefficient. We could add a new method to VMStackWalker that returns the
calling method name and in the reference implementation it will just do
the Throwable thing. Then every VM can decide if they want do add a native
method.

> Otherwise, you'd have to add a new native method.
>
>> For the security part: Is it enough to check if the class loader of
>> context[0] is the boot classloader?
>
> Not sure what the question is here.
>
In the VMStackWalker source it says only code loaded from the boot
classloader may call the methods of this class. But how should we make
sure? My question was if it is enough to check if the class in
getClassContext()[0] (i.e. the class that actually invoked a method on
VMstackWalker directly or through reflection) was loaded by the boot
classloader.


Ingo



_______________________________________________
Classpath mailing list
Classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath

Reply via email to