generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(debugger): enhance debugger with breakpoint handling and UI impr…
…ovements #183 - Add breakpoint handlers and properties for Shire debugger. - Improve debugger UI with execution console and stack frame presentation. - Refactor position manager and stack frame logic for better debugging support.
- Loading branch information
Showing
6 changed files
with
118 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 43 additions & 3 deletions
46
shirelang/src/main/kotlin/com/phodal/shirelang/debugger/ShireStackFrame.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,53 @@ | ||
package com.phodal.shirelang.debugger | ||
|
||
import com.intellij.icons.AllIcons | ||
import com.intellij.openapi.Disposable | ||
import com.intellij.ui.ColoredTextContainer | ||
import com.intellij.ui.SimpleTextAttributes | ||
import com.intellij.xdebugger.XSourcePosition | ||
import com.intellij.xdebugger.evaluation.XDebuggerEvaluator | ||
import com.intellij.xdebugger.frame.XExecutionStack | ||
import com.intellij.xdebugger.frame.XStackFrame | ||
import com.intellij.xdebugger.frame.XSuspendContext | ||
|
||
class ShireStackFrame( | ||
val functionName: String, | ||
val shireStackFrame: ShireStackFrame?, | ||
val process: ShireDebugProcess, | ||
) : XStackFrame(), Disposable { | ||
override fun customizePresentation(component: ColoredTextContainer) { | ||
// todo | ||
component.append("some title", SimpleTextAttributes.REGULAR_ATTRIBUTES) | ||
component.setIcon(AllIcons.Debugger.Frame) | ||
} | ||
|
||
override fun dispose() { | ||
|
||
} | ||
} | ||
} | ||
|
||
class ShireDebugEvaluator : XDebuggerEvaluator() { | ||
override fun evaluate(expression: String, callback: XEvaluationCallback, expressionPosition: XSourcePosition?) { | ||
//// todo | ||
} | ||
} | ||
|
||
class ShireSuspendContext(val process: ShireDebugProcess): XSuspendContext() { | ||
private val executionStacks: Array<XExecutionStack> = arrayOf( | ||
ExecutionStack(process) | ||
) | ||
|
||
override fun getActiveExecutionStack(): XExecutionStack? = executionStacks.firstOrNull() | ||
override fun getExecutionStacks(): Array<XExecutionStack> = executionStacks | ||
} | ||
|
||
class ExecutionStack(private val process: ShireDebugProcess) : | ||
XExecutionStack("SomeId") { | ||
private val stackFrames: List<ShireStackFrame> = listOf( | ||
ShireStackFrame(process) | ||
) | ||
|
||
override fun getTopFrame(): XStackFrame? = stackFrames.firstOrNull() | ||
|
||
override fun computeStackFrames(firstFrameIndex: Int, container: XStackFrameContainer) { | ||
container.addStackFrames(stackFrames, true) | ||
} | ||
} |