Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Accessing variables at a breakpoint(Extending Debug)
Accessing variables at a breakpoint [message #671681] Wed, 18 May 2011 12:48 Go to next message
Mike Aymard is currently offline Mike Aymard
Messages: 6
Registered: May 2011
Junior Member
Hi,
I want to extend the debug plugin to be able to access variable values when the user has stopped at a breakpoint AND they highlight or double-click on the corresponding method. Is this possible. I'm a little confused as to what I would extend for this. I believe I can register a breakpoint listener, but how would I know which variables are active for that line of code? Any examples of debug being extended?

Thanks!
Mike
Re: Accessing variables at a breakpoint [message #671695 is a reply to message #671681] Wed, 18 May 2011 12:55 Go to previous messageGo to next message
Deepak Azad is currently offline Deepak Azad
Messages: 545
Registered: July 2009
Senior Member
On 5/18/2011 10:18 PM, Mike Aymard wrote:
> Hi,
> I want to extend the debug plugin to be able to access variable values
> when the user has stopped at a breakpoint AND they highlight or
> double-click on the corresponding method. Is this possible. I'm a little
> confused as to what I would extend for this. I believe I can register a
> breakpoint listener, but how would I know which variables are active for
> that line of code? Any examples of debug being extended?
>
> Thanks!
> Mike

This is already possible in JDT debugger. See Variables view and
Expressions view.
Re: Accessing variables at a breakpoint [message #671700 is a reply to message #671695] Wed, 18 May 2011 13:50 Go to previous messageGo to next message
Mike Aymard is currently offline Mike Aymard
Messages: 6
Registered: May 2011
Junior Member
So I would register the breakpoint listener and then need to acquire the Variables view to get the values? Can you tell me how I can get the view? I apologize if these are dumb questions, but I'm having trouble finding examples where a plugin can gain access to this info.

Thanks!
Re: Accessing variables at a breakpoint [message #671785 is a reply to message #671700] Wed, 18 May 2011 21:27 Go to previous messageGo to next message
Deepak Azad is currently offline Deepak Azad
Messages: 545
Registered: July 2009
Senior Member
The functionality that you want to implement - 'to be able to access
variable values when the user has stopped at a breakpoint' - is already
available in the JDT debugger.

I am not sure about your reasons for trying to reinvent the wheel.
Re: Accessing variables at a breakpoint [message #671815 is a reply to message #671785] Thu, 19 May 2011 00:42 Go to previous message
Mike Aymard is currently offline Mike Aymard
Messages: 6
Registered: May 2011
Junior Member
It's not that I want to reinvent it, but didn't quite understand how to get it. I ended up using the DebugUITools.getDebugContext() to get the current variables and method information. Thanks for your help.

Mike
Previous Topic:Get IMethod using method name and source line nbr
Next Topic:JSP/XML editing
Goto Forum:
  


Current Time: Thu Aug 21 22:05:34 EDT 2014

Powered by FUDForum. Page generated in 0.06125 seconds