Ernest,

It's getting better! I can now indeed see that the processing stops at
my breakpoint, provided that it is in my main .clp file (i.e. the one
specified in (batch)). In the files that I include by way of (require)
I still observe the previous behavior.  In the light of your remarks
on files and resources, that makes some sense.

But, once I arrive at the breakpoint, nothing happens anymore. I can't
step or resume.  If I use the buttons in the Debug view, they become
grayed out but nothing happens. I also have a couple of bound
variables, that have a value in my log output, but which the debugger
thinks are 'UNKNOWN'.

As part of my application I have a modified version of Bill Wheeler's
JessWin. That serves as a reasonable replacement for a debugger till
now.  Normally I get the standard Jess opening text in there once, but
when running in the debugger I get it twice. I'm still suspecting that
something is not completely right with the duplicate specification of
the batch file (in launch configuration and Java code).

Since I have your attention, I also have another fairly minor point.
My application uses command line parameters of its own. If I want to
use the debugger, I have to skip your '-debugPorts x y' stuff. Would
it be an option to pass this information to the debugger in a Java
system property instead?

-+-  JW-+-

2010/6/4 Ernest Friedman-Hill <[email protected]>:
> Hi Jan,
>
> Encouraged by your partial success, I gave this a try and after a little
> debugging of my own, I was able to make it work! The trick is related to the
> fact that Eclipse doesn't deal with "files" but rather "resources", and
> sometimes the relationship between a file and its corresponding resource can
> get a little unclear. If you're willing to live with one more modification
> to your program, then the debugger will work transparently. What you have to
> do is use the full filesystem path as your argument to "batch" or however
> you invoke the Jess code. Use the file that's in your Eclipse workspace --
> i.e., for me, on my MacBook, I needed to use
>
> engine.batch("/Users/ejfried/workspace/DebugExperiment/code.clp");
>
> This, together with the steps below, then works like a charm. Knowing that,
> I think I can improve the next version of the debugger so that this dodge is
> unnecessary.
>
> Good luck!
>
> On Jun 4, 2010, at 8:26 AM, Jan Willem Lokin wrote:
>
>> Ernest,
>>
>> It sort of works. That is, I can see in my log output that execution
>> stops at the breakpoint. However, the Debugger does not get notified
>> of this, i.e. the Resume button stays disabled, and no information is
>> displayed in the Variables view.
>>
>> I'm wondering if it has to do with the fact that I now have to specify
>> my .clp file twice, both in my Java code and in the Debug launch
>> configuration.
>>
>> -+- JW -+-
>>
>> 2010/6/3 Ernest Friedman-Hill <[email protected]>:
>>>
>>> If your program is a Java application and you can modify main(), then
>>> it's
>>> possible that the following will work. I've never tried it, or explained
>>> this to anyone else before, so please do let us know if it works for you.
>>>
>>> In your main() routine, do this:
>>>
>>> import jess.Main;
>>> import jess.Rete;
>>>
>>> public static void main(String[] args) {
>>>   Rete engine = new Rete();
>>>   Main main = new Main();
>>>   main.initialize(args, engine);
>>>
>>>   // Then use "engine" in your program
>>> }
>>>
>>> In the JessDE, use "Debug..." to create a Jess debug configuration, and
>>> modify the main program class name to point to the main class of your
>>> application. When the debugger launches your program, it will pass some
>>> arguments to it, including
>>>
>>> -debugPorts x y
>>>
>>> where x and y are integers. That call to Main.initialize() should see
>>> those
>>> flags and open sockets to connect to those ports in background threads.
>>> Breakpoints in the debugger should then work.
>>>
>>>
>>>
>>> On Jun 3, 2010, at 8:24 AM, Jan Willem Lokin wrote:
>>>
>>>> Hi,
>>>>
>>>> My setup is a Java program which loads Jess code using
>>>> jess.Rete.batch().  I am developing my program in Eclipse using
>>>> JessDE.  Is there a way to fool the JessDE Debugger so that it will
>>>> actually break on a breakpoint that I set in my .clp files? Any
>>>> pointers as to how it could be achieved are appreciated.
>>>>
>>>> -+- JW -+-
>>>>
>>>
>>> ---------------------------------------------------------
>>> Ernest Friedman-Hill
>>> Informatics & Decision Sciences          Phone: (925) 294-2154
>>> Sandia National Labs
>>> PO Box 969, MS 9012                            [email protected]
>>> Livermore, CA 94550                             http://www.jessrules.com
>>>
>>>
>>>
>>>
>>>
>>> --------------------------------------------------------------------
>>> To unsubscribe, send the words 'unsubscribe jess-users [email protected]'
>>> in the BODY of a message to [email protected], NOT to the list
>>> (use your own address!) List problems? Notify
>>> [email protected].
>>> --------------------------------------------------------------------
>>>
>>>
>>
>>
>>
>>
>> --------------------------------------------------------------------
>> To unsubscribe, send the words 'unsubscribe jess-users [email protected]'
>> in the BODY of a message to [email protected], NOT to the list
>> (use your own address!) List problems? Notify [email protected].
>> --------------------------------------------------------------------
>
> ---------------------------------------------------------
> Ernest Friedman-Hill
> Informatics & Decision Sciences, Sandia National Laboratories
> PO Box 969, MS 9012, Livermore, CA 94550
> http://www.jessrules.com
>
>
>
>
>
>
>
> --------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users [email protected]'
> in the BODY of a message to [email protected], NOT to the list
> (use your own address!) List problems? Notify [email protected].
> --------------------------------------------------------------------
>
>




--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [email protected]'
in the BODY of a message to [email protected], NOT to the list
(use your own address!) List problems? Notify [email protected].
--------------------------------------------------------------------

Reply via email to