Wednesday, March 18, 2009

That trick NEVER works!

I created a java form to
A) Have a place to display data generated in the DLL
B) Suspend the flow of execution so that I have time to attach a debugger to the running processes.

Before I created functionality and infrastructure to pass back data from the native DLL, I wanted to take a stab at debugging the running code. I want to be able to just attach the windows debugger to a process that runs the DLL, but that is the kind of stuff that should work, but never does.

I started my java in the NetBeans debugger, and up popped my form with it's single button. From Visual studio, I attached the windows debugger to the running hava precess. When I clicked "Launch" it stepped through a couple of java break points, then called the native function.

Presto, the my first breakpoint at the entry function hits, and the Windows debugger opens.
"**** ****!" I say, "That's what was SUPPOSED to happen!" Now I can trace my goofy hack to convert a Java array of unicode Strings into C **char and pass it to the native code. More amazement, it has actually worked on the first try. Now I have to make it work The Right Way.

No comments:

Post a Comment