Debugging Table Conversions (BSFNs)

DBohner-(db)

Legendary Poster
Howdy,

This past week I came across an interesting situation... I have been
learning how to debug C functions (thanks GuitarMan) - so I was trying to
figure out why some data was being returned so 'poorly' within a Table
Conversion.

I'd start the C debugging process as usual - F5 from the MS C++ tool, then
walk through the steps to kick off the TC locally. To my amazement, the
debugger never gets tripped... HUH??

I copied the logic from the TC to a normal UBE, repeated the steps to kick
off the UBE, locally, and the debugger gets tripped at its breakpoints as
expected...

After watching my box a while, I have determined that (and please correct
me) UBEPrint.EXE appears to be the controlling object of the TC.

So, now the question ... for those that like to play with these things...
what additional steps do I need to complete setup to debug a TC within the C
debugger?

Lost?

Daniel
[email protected]
www.existinglight.net

AS/400 SP 18 XE (where did these things go, by default?)






Daniel Bohner
[email protected]
www.existinglight.net
JDE - XE, SP 18 & AS/400 V4R5.0
JDE - B7331 & MS SQL 7x
 
There is an entry in the JDE.ini file (UBE Section) "UBEThread=0". If this is set to 0 then the debug should be run against LaunchUbe.exe. Never could get this to work properly so I just blow the entry from the JDE.ini and debug normally (if thats the word)
 
Roger,
That switch is what causes UBE's to run in a thread under oexplore.exe and not as a new process with launchube. If you have ube's running in that thread the only way to get away from that is to start launchube manually.

Daniel, on the other hand, should be able to use the launchube.exe as the primary process to debug from. Set up your project with launchube as the main executable, add your dlls, set your breaks and go.

Let us know what happens.
 
It's been a while but I believe the following method will work too:

1. In your business function type:

ASSERT(FALSE);

near where you want to debug

2. Compile your business function and run your TC
3. You will notice that when your TC runs, it will throw up an Assertion Dialog box (because hey you added the ASSERT in step 1).
4. You can now use Visual C's "Build->Start Debug->Attach to Process" menu command to attach to the TC.
5. Set your breakpoint in the code where you want and debug away!

(I think you can also press the "Debug" button on the ASSERT dialog box as well. instead of actually attaching to the process)

After you attach to the running process, you may have to setup "Project->Settings->Debug->Additional DLLs" to include the DLL on the BSFN that you are debugging.

Remember to remove the ASSERT statement when you are done debugging your function.

Good luck anyway...
 
Back
Top