[Openmcl-devel] Debugging in Kernel in Windows vista 32 bit

Seth seth at tewebs.com
Sun Dec 20 18:28:26 UTC 2009


Im trying to port the RDNZL library to clozure. 
However the code throws me in the low level debugger. I have wrote some test code
that actually works and then i have intentionally put an error in so i know the
error source. Now i would like to verify the source of error, assuming i didn't
know it, by somehow detecting the error thrown in the c function. Of course the
goal is to figure out why the test code i want doesn't work.

Just for an idea, this is the c++ code:

__declspec(dllexport) void* invokeStaticMember(const __wchar_t *methodName, void
*type, int nargs, void *args[]) {
		Type ^t = safe_cast<Type ^>(static_cast<DotNetContainer
*>(type)->getContainerObject());
                return InvokeMember::invokeMethod(nullptr, t, methodName, nargs,
args, static_cast<BindingFlags>              
                                                           (BindingFlags::Static
| BindingFlags::Public));
}

	
And this is my working test code:
(in-package :rdnzl)

(defun %invoke-instance-member (method-name type nargs args)
  (ccl::with-native-utf-16-cstr (mn method-name)
    (ccl:external-call "invokeInstanceMember"
      :address mn :address type :signed-int nargs
      :address args :address)))

 
(defun test-invoke-2 ()
   (let ((obj (make-type-from-name "System.Reflection.Assembly")))
     (%invoke-instance-member "ToString" (pointer obj) 0 (ccl::%null-ptr))))


I introduce the error by chaing ToString to TToString. 
I would somehow like to 'catch' the error in the precompiled dll to see what
error is thrown . All that the kernel tells me
is that an "Exception occured while executing foreign code".

Can anyone suggest a good way to do this? Thanks!


Also, as a side note, is there any way to prevent clozure going into this kernel
by catching the error?

---- Msg sent via WebMail



More information about the Openmcl-devel mailing list