@@ -5,7 +5,7 @@ Begin VB.Form Form1
55 Caption = "Form1"
66 ClientHeight = 12000
77 ClientLeft = 60
8- ClientTop = 345
8+ ClientTop = 630
99 ClientWidth = 13905
1010 KeyPreview = -1 'True
1111 LinkTopic = "Form1"
@@ -284,20 +284,22 @@ Begin VB.Form Form1
284284 ImageKey = "Step Out"
285285 EndProperty
286286 BeginProperty Button12 {66833 FEA-8583 -11 D1-B16A-00 C0F0283628}
287- Key = "Set Next "
288- Object .ToolTipText = "Set Next Statement "
287+ Key = "Run to Cursor "
288+ Object .ToolTipText = "Run to Cursor "
289289 ImageKey = "Set Next"
290290 EndProperty
291291 BeginProperty Button13 {66833 FEA-8583 -11 D1-B16A-00 C0F0283628}
292292 Style = 3
293293 EndProperty
294294 BeginProperty Button14 {66833 FEA-8583 -11 D1-B16A-00 C0F0283628}
295+ Object .Visible = 0 'False
295296 Key = "Immediate"
296297 Object .ToolTipText = "Immediate Window"
297298 ImageKey = "Immediate"
298299 Style = 1
299300 EndProperty
300301 BeginProperty Button15 {66833 FEA-8583 -11 D1-B16A-00 C0F0283628}
302+ Object .Visible = 0 'False
301303 Key = "Callstack"
302304 Object .ToolTipText = "Callstack"
303305 ImageKey = "Callstack"
@@ -379,6 +381,12 @@ Begin VB.Form Form1
379381 Top = 6525
380382 Width = 1860
381383 End
384+ Begin VB.Menu mnuCallStackPopup
385+ Caption = "mnuCallStackPopup"
386+ Begin VB.Menu mnuExecuteTillReturn
387+ Caption = "Execute Until Return"
388+ End
389+ End
382390End
383391Attribute VB_Name = "Form1"
384392Attribute VB_GlobalNameSpace = False
@@ -397,14 +405,20 @@ Private Declare Sub SetCallBacks Lib "sb_engine" (ByVal msgProc As Long, ByVal d
397405
398406Dim loadedFile As String
399407Dim hsbLib As Long
408+ Dim lastEIP As Long
400409
401-
402-
410+ Const SC_MARK_CIRCLE = 0
411+ Const SC_MARK_ARROW = 2
412+ Dim selCallStackItem As ListItem
413+ Dim selVariable As ListItem
403414
404415Private Sub cmdManual_Click ()
405- txtDebug.Text = Empty
406- dbg_cmd = txtCmd.Text
407- readyToReturn = True
416+ 'txtDebug.Text = Empty
417+ 'dbg_cmd = txtCmd.Text
418+ 'readyToReturn = True
419+
420+ MsgBox GetVariableValue(txtCmd.Text)
421+
408422End Sub
409423
410424Private Sub RefreshVariables ()
@@ -421,6 +435,7 @@ Private Sub RefreshVariables()
421435 li.SubItems(1 ) = v.name
422436 li.SubItems(2 ) = v.varType
423437 li.SubItems(3 ) = v.value
438+ If v.varType = "array" Then li.Tag = v.pAryElement
424439 Next
425440
426441End Sub
@@ -441,13 +456,43 @@ Private Sub RefreshCallStack()
441456
442457End Sub
443458
459+ Private Sub lvCallStack_ItemClick (ByVal Item As MSComctlLib .ListItem)
460+ scivb.GotoLine CLng(Item.Text)
461+ Set selCallStackItem = Item
462+ End Sub
463+
464+ Private Sub lvVars_DblClick ()
465+ If selVariable Is Nothing Then Exit Sub
466+ If selVariable.SubItems(2 ) <> "array" Then Exit Sub
467+
468+ Dim c As Collection
469+ Dim varName As String
470+
471+ varName = selVariable.SubItems(1 )
472+ Set c = EnumArrayVariables(varName)
473+ If c.Count > 0 Then
474+ frmAryDump.DumpArrayValues varName, c
475+ End If
476+
477+ End Sub
478+
479+ Private Sub lvVars_ItemClick (ByVal Item As MSComctlLib .ListItem)
480+ Set selVariable = Item
481+ End Sub
482+
483+ Private Sub mnuExecuteTillReturn_Click ()
484+ MsgBox "todo: disable all breakpoints,run to line selCallStackItem.text + 1, reenable breakpoints" , vbInformation
485+ End Sub
486+
444487Private Sub scivb_KeyDown (KeyCode As Long , Shift As Long )
445- Debug.Print KeyCode & " " & Shift
488+
489+ 'Debug.Print KeyCode & " " & Shift
446490 Select Case KeyCode
447491 Case vbKeyF2: ToggleBreakPoint scivb.CurrentLine
448492 Case vbKeyF5: If running Then DebuggerCmd "R" Else ExecuteScript True
449- Case vbKeyF7: DebuggerCmd "s"
450- Case vbKeyF8: DebuggerCmd "S"
493+ Case vbKeyF7: DebuggerCmd "s" 'step into
494+ Case vbKeyF8: DebuggerCmd "S" 'step over
495+ Case vbKeyF9: DebuggerCmd "o" 'step out
451496 End Select
452497
453498End Sub
@@ -475,10 +520,10 @@ Private Sub tbarDebug_ButtonClick(ByVal Button As MSComctlLib.Button)
475520 Case "Stop" : DebuggerCmd "q"
476521 Case "Step In" : DebuggerCmd "s"
477522 Case "Step Over" : DebuggerCmd "S"
478- Case "Step Out" : DebuggerCmd "u "
479- Case "Set Next" :
480- Case "Immediate"
481- Case "Callstack"
523+ Case "Step Out" : DebuggerCmd "o "
524+ Case "Run to Cursor" : RunToLine scivb.CurrentLine + 1
525+ ' Case "Immediate"
526+ ' Case "Callstack"
482527 Case "Breakpoint" :
483528 Case "Clear Breakpoints" :
484529 End Select
@@ -511,12 +556,14 @@ Private Sub ExecuteScript(Optional withDebugger As Boolean)
511556 running = False
512557 scivb.ReadOnly = False
513558 scivb.HighLightActiveLine = False
514-
559+ scivb.DeleteMarker lastEIP, 1
515560
516561End Sub
517562
518563Private Sub Form_Load ()
519564
565+ mnuCallStackPopup.Visible = False
566+
520567 hsbLib = LoadLibrary(App.Path & "\engine\sb_engine.dll" )
521568
522569 If hsbLib = 0 Then
@@ -527,9 +574,15 @@ Private Sub Form_Load()
527574 scivb.LoadHighlighter App.Path & "\dependancies\vb.bin"
528575
529576 scivb.DirectSCI.HideSelection False
577+ scivb.DirectSCI.MarkerDefine 2 , SC_MARK_CIRCLE
530578 scivb.DirectSCI.MarkerSetFore 2 , vbRed 'set breakpoint color
531579 scivb.DirectSCI.MarkerSetBack 2 , vbRed
532580
581+ scivb.DirectSCI.MarkerDefine 1 , SC_MARK_ARROW
582+ scivb.DirectSCI.MarkerSetFore 1 , vbBlack 'current eip
583+ scivb.DirectSCI.MarkerSetBack 1 , vbYellow
584+
585+
533586 lvCallStack.ColumnHeaders(2 ).Width = lvCallStack.Width - lvCallStack.ColumnHeaders(2 ).Left - 100
534587 lvVars.ColumnHeaders(lvVars.ColumnHeaders.Count).Width = lvVars.Width - lvVars.ColumnHeaders(lvVars.ColumnHeaders.Count).Left - 100
535588
@@ -566,8 +619,11 @@ Public Sub SyncUI()
566619
567620 Dim curLine As Long
568621
622+ scivb.DeleteMarker lastEIP, 1
623+
569624 curLine = GetCurrentDebugLine(hDebugObject)
570- Me.Caption = "Current Line: " & curLine
625+ scivb.SetMarker curLine, 1
626+ lastEIP = curLine
571627
572628 scivb.GotoLine curLine
573629 scivb.HighLightActiveLine = True
0 commit comments