I guess that would work, but I found the following to be much easier: 1) start java in the debugger. You'll need to specify the actual java executable, not whatever is in C:\Windows\System32\java. You do this with the command: devenv /debugexe C:\Program Files\...\java.exe MyClass
2) One in the debugger, set a breakpoint in your dll module using the breakpoint menu and a fully qualified breakpoint location. For example, to set a breakpoint on the AttachThread() API routine in oorexx, I'd specify the breakpoing as: {,InterpreterInstanceStubs.cpp,rexx.dll} @63 The @63 is the source file line number. Since you quallified this using the rexx.dll, it will handle the breakpoint even though rexx.dll is dynamically loaded. Once this is loaded, then all of the symbols are available and normal means can be used to set break points. Rick On Tue, Jun 2, 2009 at 12:07 PM, Rony G. Flatscher <rony.flatsc...@wu-wien.ac.at> wrote: > As some of you may know, I have been struggling to debug a DLL library, > that in one scenario gets loaded by Java, for weeks by now. > > So far it has not been possible for me to really get the VS debugger to step > in (even if following all the valuable advice I received via this list, > after attaching to the java.exe process and having defined breakpoints for > the DLL). > > Now, it seems that I have found a way to achieve that and would like to > share this with you, in case you might once run into a comparable problem > (that one program takes over all debugging, such that VS cannot step in). > Remebering a remark from Mark Miesfeld, I started out to research again that > statement that was able to trigger VS, this time using a new approach in > research and was lucky enough to find a few hints. The most valuable piece > of information is from <http://ccollomb.free.fr/blog/?p=30>, which explains > different ways of how to insert statements in one's code to trigger the > debugger. > > Here are hints from that article: > > define a macro: > > #define BREAK_HERE_SINGLESTEP() __asm __emit 0xF1 > > and later in the code use it wherever you want to start to debug in single > step mode, enter: > > BREAK_HERE_SINGLESTEP(); > > this macro has the stated benefit, that it goes right into single stepping > mode, without firing up the exception dialog. However, it did not work in my > situation, as java.exe even consumed that one. > > However the cited means that cause the exception popup to appear (and > therefore allows one to invoke VS) would work. Just enter one of > > __asm int 3; > DebugBreak(); > __asm __emit 0xCC; > __asm __emit 0xCD; __asm __emit 0×03; > __debugbreak(); > _CrtDbgBreak(); > > Did experiment with the first two forms (highlighted in bold), and both > worked. From this moment on the VS-set breakpoints get honored. > > Again, not having found this information easily I think that once found, it > should be communicated for those who may have a need for such a triggering > of the debugger sometimes in the unspecified future. > > Hoping, that with this I will be able to corner the problem from one > particular user's use-case (employing multiple Java threads dispatching Rexx > scripts and then Halt() and Terminate() the interpreter instances), finally. > > ---rony > > > ------------------------------------------------------------------------------ > OpenSolaris 2009.06 is a cutting edge operating system for enterprises > looking to deploy the next generation of Solaris that includes the latest > innovations from Sun and the OpenSource community. Download a copy and > enjoy capabilities such as Networking, Storage and Virtualization. > Go to: http://p.sf.net/sfu/opensolaris-get > _______________________________________________ > Oorexx-devel mailing list > Oorexx-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > > ------------------------------------------------------------------------------ OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get _______________________________________________ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel