42 defaultKeyboardMap := DebugView defaultKeyboardMap copy. |
42 defaultKeyboardMap := DebugView defaultKeyboardMap copy. |
43 defaultKeyboardMap bindValue: #DebuggerRestart to: ('Ctrl', (defaultKeyboardMap bindingForLogical: #DebuggerContinue)) asSymbol. |
43 defaultKeyboardMap bindValue: #DebuggerRestart to: ('Ctrl', (defaultKeyboardMap bindingForLogical: #DebuggerContinue)) asSymbol. |
44 |
44 |
45 "Created: / 05-06-2017 / 23:01:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
45 "Created: / 05-06-2017 / 23:01:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
46 "Modified: / 11-06-2017 / 20:08:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
46 "Modified: / 11-06-2017 / 20:08:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
47 ! ! |
|
48 |
|
49 !VDBDebuggerApplication class methodsFor:'accessing - defaults'! |
|
50 |
|
51 defaultUserInit |
|
52 "Return path to user-specific VDB initi file (as Filename). |
|
53 Use this to customize VDB upon startup. |
|
54 If it does not exist, try create one with some defaults." |
|
55 |
|
56 | gdbinit | |
|
57 |
|
58 gdbinit := Filename homeDirectory / '.vdbinit.st'. |
|
59 gdbinit exists ifFalse:[ |
|
60 [ |
|
61 gdbinit |
|
62 writingFileDo:[:s | |
|
63 s |
|
64 nextPutLine:'"/ VDB init script'; |
|
65 nextPutLine:'"/ Current VDB instance can be accessed in via variable `vdb`'; |
|
66 nextPutLine:'"/'; |
|
67 nextPutLine:'"/ Set prompt'; |
|
68 nextPutLine:'vdb debugger send: ''set prompt (vdb) ''.'; |
|
69 cr; |
|
70 nextPutLine:'"/ Set default font:'; |
|
71 nextPutLine:'"/ VDBAbstractApplication defaultTextFont: (CodeView defaultFont asSize: 16).'; |
|
72 yourself. |
|
73 ]. |
|
74 ] on:Error |
|
75 do:[:ex | |
|
76 gdbinit exists ifTrue:[ |
|
77 gdbinit remove |
|
78 ]. |
|
79 ^ nil |
|
80 ]. |
|
81 ]. |
|
82 ^ gdbinit |
|
83 |
|
84 " |
|
85 VDBDebuggerApplication defaultUserInit" |
|
86 |
|
87 "Created: / 31-08-2018 / 07:03:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
47 ! ! |
88 ! ! |
48 |
89 |
49 !VDBDebuggerApplication class methodsFor:'interface opening'! |
90 !VDBDebuggerApplication class methodsFor:'interface opening'! |
50 |
91 |
51 open |
92 open |
1067 ! |
1108 ! |
1068 |
1109 |
1069 subscribe |
1110 subscribe |
1070 "Register for debugger events. To be overrided by subclasses" |
1111 "Register for debugger events. To be overrided by subclasses" |
1071 |
1112 |
|
1113 | init | |
|
1114 |
|
1115 "/ Read init file |
|
1116 init := self class defaultUserInit. |
|
1117 (init notNil and:[ init exists ]) ifTrue:[ |
|
1118 [ |
|
1119 [ |
|
1120 Workspace workspaceVariableAt: 'vdb' put: self. |
|
1121 init fileIn. |
|
1122 ] ensure:[ |
|
1123 Workspace workspaceVariables removeKey: 'vdb'. |
|
1124 ]. |
|
1125 ] on: Error do:[:ex | |
|
1126 Transcript |
|
1127 showCR: ('Error while reading VGB init file (%1)' bindWith: init pathName); |
|
1128 showCR: ('Description: %1' bindWith: ex description); |
|
1129 showCR: ('Backtrace:'); |
|
1130 cr. |
|
1131 ex suspendedContext fullPrintAllOn: Transcript. |
|
1132 Transcript showCR:'------'. |
|
1133 ]. |
|
1134 |
|
1135 ]. |
|
1136 |
1072 UserPreferences current vdbPrettyPrintingEnabled ifTrue:[ |
1137 UserPreferences current vdbPrettyPrintingEnabled ifTrue:[ |
1073 debugger enablePrettyPrinting |
1138 debugger enablePrettyPrinting |
1074 ]. |
1139 ]. |
1075 UserPreferences current vdbFrameFiltersEnabled ifTrue:[ |
1140 UserPreferences current vdbFrameFiltersEnabled ifTrue:[ |
1076 debugger enableFrameFilters |
1141 debugger enableFrameFilters |
1083 when: GDBThreadGroupExitedEvent send: #onThreadGroupExitedEvent: to: self; |
1148 when: GDBThreadGroupExitedEvent send: #onThreadGroupExitedEvent: to: self; |
1084 when: GDBThreadSelectedEvent send: #onThreadSelectedEvent: to: self; |
1149 when: GDBThreadSelectedEvent send: #onThreadSelectedEvent: to: self; |
1085 when: GDBLogOutputEvent send: #onLogOutputEvent: to: self. |
1150 when: GDBLogOutputEvent send: #onLogOutputEvent: to: self. |
1086 |
1151 |
1087 "Created: / 21-09-2014 / 22:43:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1152 "Created: / 21-09-2014 / 22:43:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1088 "Modified: / 30-07-2018 / 07:32:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1153 "Modified: / 31-08-2018 / 07:24:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1089 ! ! |
1154 ! ! |
1090 |
1155 |
1091 !VDBDebuggerApplication methodsFor:'menu actions'! |
1156 !VDBDebuggerApplication methodsFor:'menu actions'! |
1092 |
1157 |
1093 doAttachToRR |
1158 doAttachToRR |