Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to debug Command Core Expressions
How to debug Command Core Expressions [message #547862] Mon, 19 July 2010 21:24 Go to next message
Eric Jain is currently offline Eric JainFriend
Messages: 266
Registered: July 2009
Senior Member
Ever so often I'm stuck with e.g. an expression that doesn't seem to work (so e.g. a handler that is supposed to be enabled isn't).

No matter how much I mess up the expressions, there are never any errors or warnings logged.

There must be a way to see what's going on, but I don't see anything mentioned at http://wiki.eclipse.org/Command_Core_Expressions.
Re: How to debug Command Core Expressions [message #548007 is a reply to message #547862] Tue, 20 July 2010 12:06 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Because it's generic code, it's probably not good enough to put a
breakpoint in one of the Expression implementations (that's like adding
a breakpoint in "for" or "if").

I would put a conditional breakpoint in
org.eclipse.ui.internal.handlers.HandlerProxy.setEnabled(Obj ect), since
that's where enabledWhen is calculated.

You basically need to find your handler and then make the breakpoin in
setEnabled(*) an "Instance breakpoint". That will allow you to walk the
core expressions while they are being evaluated.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: How to debug Command Core Expressions [message #548121 is a reply to message #548007] Tue, 20 July 2010 17:24 Go to previous messageGo to next message
Eric Jain is currently offline Eric JainFriend
Messages: 266
Registered: July 2009
Senior Member
Thanks. Before resorting to digging around in the code to set instance breakpoints I was hoping that setting some tracing options such as

org.eclipse.core.expressions/debug/TypeExtensionManager
org.eclipse.core.expressions/trace/tracePropertyResolving

would be sufficient. Neither of these two options seem to be all that useful, but perhaps there are other tracing options that might help?
Re: How to debug Command Core Expressions [message #548701 is a reply to message #548121] Thu, 22 July 2010 17:04 Go to previous message
Mark Storer is currently offline Mark StorerFriend
Messages: 46
Registered: May 2010
Location: Vista, CA
Member

You might have some luck with org.eclipse.ui's trace options. In particular:

  • trace/commands
  • trace/handlers
  • trace/handlers.verbose
  • trace/handlers.verbose.commandId (keeps the spam down?)

To be frank, I haven't had much luck on this front either. Getting up the initial core expression learning curve was rough, even with the link in Paul's signature (thank you, by the way... I'd have been Up A Creek without it).


--Mark Storer
Senior Software Engineer
Autonomy Cardiff

import legalese.disclaimer;
Disclaimer<Cardiff> disCard = null;

Google Code Search
Previous Topic:Plug-ins installed but not available
Next Topic:Struggling with IEditorInput
Goto Forum:
  


Current Time: Sun Dec 21 20:55:36 GMT 2014

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

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