Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » displaying editor for a stack frame
displaying editor for a stack frame [message #98692] Wed, 23 July 2003 14:02 Go to next message
Eclipse UserFriend
I am having trouble with a plugin for my own programming language. When
stepping into an include file, the editor for the new file does not get
displayed. Rather, the main source file editor stays current. As I continue
to step, the active line moves in my main source file. The line number that
is active in my main source file is the line number that is really executing
in my include file.

I think this might have to do with the way that I am using IStackFrame.
Conceptually, each stack frame appears to have an associated editor and
current line (although I don't see any mention of an editor in the
documentation for IStackFrame). My language plugin does not yet support
callstacks. So I only ever create one IStackFrame. I wonder is having only
this single stack frame is the reason that the editor for my include file
doesn't get displayed.

I have a source code locator, and it only gets called once at the beggining
of the debug session. Looking at the class 'LaunchView', that is part of the
Eclipse core, it seems that the editor gets cached and so my source locator
is only ever called once. How can I get my source code locator to be called
after every step action, or breakpoint?

Here is the caching code from LaunchView
(org.eclipse.debug.internal.ui.views.launch)

protected void openEditorForStackFrame(IStackFrame stackFrame) {
if (fShowingEditor) {
return;
}
try {
fShowingEditor = true;

if (!stackFrame.isSuspended()) {
return;
}

//!!! no editor lookup if we already have one
if (stackFrame.equals(getStackFrame())) {
if (getEditorInput() == null || getEditorId() == null) {
lookupEditorInput(stackFrame);
}
} else {
setStackFrame(stackFrame);
lookupEditorInput(stackFrame);
}
if (getEditorInput() == null || getEditorId() == null) {
return;
}
...

note:
protected IEditorInput getEditorInput() {
return fEditorInput;
}
protected IEditorInput getEditorId() {
return fEditorId;
}


Thanks

--
-----------------------------------------------
Patrick Baker
Stilo Corporation
pbaker@ca.stilo.com

"Hail, twin companionship, children of Mars."

This message, including any attachments, is for the sole use of the
intended recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure, copying, or
distribution is strictly prohibited. If you are not the intended
recipient(s) please contact the sender by reply email and destroy
all copies of the original message and any attachments.
Re: displaying editor for a stack frame [message #98724 is a reply to message #98692] Wed, 23 July 2003 15:42 Go to previous message
Eclipse UserFriend
When you move to the new source code locator, you will need to fire a debug
event notifying that a change has occurred for the stack frame.
This will remove the cached stack frame in the launch view and force another
source lookup.

See LaunchViewEventHandler.doHandleDebugEvents and
LaunchView.setStackFrame(IStackFrame)

HTH
Darins

"Patrick Baker" <pbaker@ca.stilo.com> wrote in message
news:bfmik9$lk7$1@eclipse.org...
> I am having trouble with a plugin for my own programming language. When
> stepping into an include file, the editor for the new file does not get
> displayed. Rather, the main source file editor stays current. As I
continue
> to step, the active line moves in my main source file. The line number
that
> is active in my main source file is the line number that is really
executing
> in my include file.
>
> I think this might have to do with the way that I am using IStackFrame.
> Conceptually, each stack frame appears to have an associated editor and
> current line (although I don't see any mention of an editor in the
> documentation for IStackFrame). My language plugin does not yet support
> callstacks. So I only ever create one IStackFrame. I wonder is having only
> this single stack frame is the reason that the editor for my include file
> doesn't get displayed.
>
> I have a source code locator, and it only gets called once at the
beggining
> of the debug session. Looking at the class 'LaunchView', that is part of
the
> Eclipse core, it seems that the editor gets cached and so my source
locator
> is only ever called once. How can I get my source code locator to be
called
> after every step action, or breakpoint?
>
> Here is the caching code from LaunchView
> (org.eclipse.debug.internal.ui.views.launch)
>
> protected void openEditorForStackFrame(IStackFrame stackFrame) {
> if (fShowingEditor) {
> return;
> }
> try {
> fShowingEditor = true;
>
> if (!stackFrame.isSuspended()) {
> return;
> }
>
> //!!! no editor lookup if we already have one
> if (stackFrame.equals(getStackFrame())) {
> if (getEditorInput() == null || getEditorId() == null) {
> lookupEditorInput(stackFrame);
> }
> } else {
> setStackFrame(stackFrame);
> lookupEditorInput(stackFrame);
> }
> if (getEditorInput() == null || getEditorId() == null) {
> return;
> }
> ...
>
> note:
> protected IEditorInput getEditorInput() {
> return fEditorInput;
> }
> protected IEditorInput getEditorId() {
> return fEditorId;
> }
>
>
> Thanks
>
> --
> -----------------------------------------------
> Patrick Baker
> Stilo Corporation
> pbaker@ca.stilo.com
>
> "Hail, twin companionship, children of Mars."
>
> This message, including any attachments, is for the sole use of the
> intended recipient(s) and may contain confidential and privileged
> information. Any unauthorized review, use, disclosure, copying, or
> distribution is strictly prohibited. If you are not the intended
> recipient(s) please contact the sender by reply email and destroy
> all copies of the original message and any attachments.
>
>
Previous Topic:Re: mark editor as dirty
Next Topic:Re: CDT in CVS repository?
Goto Forum:
  


Current Time: Sun Jun 22 13:46:23 EDT 2025

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

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

Back to the top