Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Complete OCL Debugging
Complete OCL Debugging [message #986031] Sat, 17 November 2012 19:02 Go to next message
Andrea Sindico is currently offline Andrea SindicoFriend
Messages: 266
Registered: November 2010
Senior Member

What is the easiest (or the most effective) way to debug complete ocl? I am now copying and pasting pieces of a Complete OCL file in the OCL console but it would be great if I could put breakpoints or at least print object values in the Console

Follow me on Twitter @andreasindico

Re: Complete OCL Debugging [message #986040 is a reply to message #986031] Sat, 17 November 2012 19:42 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

You're doing what I would recommend.

The QVTo debugger is quite useful so if you can wrap your Complete OCL
in a QVTo transformation that might help.

QVTo has a log() function.

OCL has a toString() that Eclipse OCL extends to everything.

You can add custom Java functions to your meta-model that print things
in your favourite way.

I've just fixed a bug, not yet on master, that allows e.g. a derived
"label" attribute to redirect to "label()" that can be overridden with
per-Object text representation. (There was a bug in the dynamic
dispatch.) This then works really well if "label" is high enough in the
inheritance so that it is the EAttribute that EMF chooses as the default
label provider.

Generalizing the QVTo debugger for the new Pivot-based OCL and for
extension to QVTc and QVTr is in my plans, but it doesn't help you now.

Regards

Ed Willink

On 17/11/2012 19:02, Andrea Sindico wrote:
> What is the easiest (or the most effective) way to debug complete ocl?
> I am now copying and pasting pieces of a Complete OCL file in the OCL
> console but it would be great if I could put breakpoints or at least
> print object values in the Console
Re: Complete OCL Debugging [message #986308 is a reply to message #986040] Mon, 19 November 2012 20:03 Go to previous messageGo to next message
Andrea Sindico is currently offline Andrea SindicoFriend
Messages: 266
Registered: November 2010
Senior Member

Hi Ed,
what is the log function syntax?

thank you for your kind help

Andrea


Follow me on Twitter @andreasindico

Re: Complete OCL Debugging [message #986312 is a reply to message #986308] Mon, 19 November 2012 21:17 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I use

log('message', someObject)

but the QVTo spec is up to four arguments.

Regards

Ed Willink



On 19/11/2012 20:03, Andrea Sindico wrote:
> Hi Ed,
> what is the log function syntax?
>
> thank you for your kind help
>
> Andrea
Re: Complete OCL Debugging [message #986320 is a reply to message #986312] Mon, 19 November 2012 23:14 Go to previous messageGo to next message
Andrea Sindico is currently offline Andrea SindicoFriend
Messages: 266
Registered: November 2010
Senior Member

I think it would be great if OCL had a log function as well which may always returns true so that it could be used in invariant evaluations.


Follow me on Twitter @andreasindico

Re: Complete OCL Debugging [message #986465 is a reply to message #986320] Tue, 20 November 2012 14:34 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I've meaning to do this for some time.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=394660

(also https://bugs.eclipse.org/bugs/show_bug.cgi?id=394658).

The logging function is fairly easy, particularly if you restrict the
message-expression to a string literal; perhaps you'd like to try it.

Bothy should be independent of the OCL core; just additional library
functions.

Regards

Ed Willink




On 19/11/2012 23:14, Andrea Sindico wrote:
> I think it would be great if OCL had a log function as well which may
> always returns true so that it could be used in invariant evaluations.
Re: Complete OCL Debugging [message #986535 is a reply to message #986031] Tue, 20 November 2012 19:51 Go to previous messageGo to next message
Andrea Sindico is currently offline Andrea SindicoFriend
Messages: 266
Registered: November 2010
Senior Member

Hi Ed,
where may I find the latest source code?
A tried at http://www.eclipse.org/modeling/mdt/downloads/?project=ocl downloading both the SDK and the Core SDK but I could not find any src file in there
Also is there any doc about the source architecture? is it an Xtext project?

Regards


Follow me on Twitter @andreasindico

Re: Complete OCL Debugging [message #986543 is a reply to message #986535] Tue, 20 November 2012 20:40 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

See http://wiki.eclipse.org/MDT/OCL#Downloads_and_Updates and
http://wiki.eclipse.org/MDT/OCL/Dev/Setup#Getting_the_Sources_from_GIT.

The only archirtecture documentation concerns the pre-Pivot, pre-Xtext
code. http://wiki.eclipse.org/MDT/OCL/4.X_Architecture is a bit old but
in overview not much changed.

Regards

Ed Willink


On 20/11/2012 19:51, Andrea Sindico wrote:
> Hi Ed,
> where may I find the latest source code?
> A tried at http://www.eclipse.org/modeling/mdt/downloads/?project=ocl
> downloading both the SDK and the Core SDK but I could not find any src
> file in there
> Also is there any doc about the source architecture? is it an Xtext
> project?
>
> Regards
>
Re: Complete OCL Debugging [message #986633 is a reply to message #986031] Wed, 21 November 2012 09:23 Go to previous message
Andrea Sindico is currently offline Andrea SindicoFriend
Messages: 266
Registered: November 2010
Senior Member

I guess I need a bit of support.
As it could be useful for others and, out of this topic, I created another topic: http://www.eclipse.org/forums/index.php/m/986629/#msg_986629


Follow me on Twitter @andreasindico

Previous Topic:[Announce] Eclipse OCL 4.1.0 (Kepler) M3 is now available
Next Topic:Modifying SRC
Goto Forum:
  


Current Time: Sat Apr 20 03:49:59 GMT 2024

Powered by FUDForum. Page generated in 0.03988 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top