Helios-Debugger.js 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039
  1. smalltalk.addPackage('Helios-Debugger');
  2. smalltalk.addClass('HLContextInspectorDecorator', smalltalk.Object, ['context'], 'Helios-Debugger');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "context",
  6. category: 'accessing',
  7. fn: function (){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx1) {
  10. var $1;
  11. $1=self["@context"];
  12. return $1;
  13. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.HLContextInspectorDecorator)})},
  14. args: [],
  15. source: "context\x0a\x09^ context",
  16. messageSends: [],
  17. referencedClasses: []
  18. }),
  19. smalltalk.HLContextInspectorDecorator);
  20. smalltalk.addMethod(
  21. smalltalk.method({
  22. selector: "initializeFromContext:",
  23. category: 'initialization',
  24. fn: function (aContext){
  25. var self=this;
  26. return smalltalk.withContext(function($ctx1) {
  27. self["@context"]=aContext;
  28. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromContext:",{aContext:aContext},smalltalk.HLContextInspectorDecorator)})},
  29. args: ["aContext"],
  30. source: "initializeFromContext: aContext\x0a\x09context := aContext",
  31. messageSends: [],
  32. referencedClasses: []
  33. }),
  34. smalltalk.HLContextInspectorDecorator);
  35. smalltalk.addMethod(
  36. smalltalk.method({
  37. selector: "inspectOn:",
  38. category: 'inspecting',
  39. fn: function (anInspector){
  40. var self=this;
  41. var variables,inspectedContext;
  42. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  43. return smalltalk.withContext(function($ctx1) {
  44. var $1,$2,$3;
  45. variables=_st($Dictionary())._new();
  46. inspectedContext=self._context();
  47. _st(variables)._addAll_(_st(inspectedContext)._locals());
  48. _st((function(){
  49. return smalltalk.withContext(function($ctx2) {
  50. return _st(_st(inspectedContext)._notNil())._and_((function(){
  51. return smalltalk.withContext(function($ctx3) {
  52. return _st(inspectedContext)._isBlockContext();
  53. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  54. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  55. return smalltalk.withContext(function($ctx2) {
  56. inspectedContext=_st(inspectedContext)._outerContext();
  57. inspectedContext;
  58. $1=inspectedContext;
  59. if(($receiver = $1) == nil || $receiver == undefined){
  60. return $1;
  61. } else {
  62. return _st(variables)._addAll_(_st(inspectedContext)._locals());
  63. };
  64. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  65. $2=anInspector;
  66. _st($2)._setLabel_("Context");
  67. $3=_st($2)._setVariables_(variables);
  68. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables,inspectedContext:inspectedContext},smalltalk.HLContextInspectorDecorator)})},
  69. args: ["anInspector"],
  70. source: "inspectOn: anInspector\x0a\x09| variables inspectedContext |\x0a\x09\x0a\x09variables := Dictionary new.\x0a\x09inspectedContext := self context.\x0a\x09\x0a\x09variables addAll: inspectedContext locals.\x0a\x09\x0a\x09[ inspectedContext notNil and: [ inspectedContext isBlockContext ] ] whileTrue: [\x0a\x09\x09inspectedContext := inspectedContext outerContext.\x0a\x09\x09inspectedContext ifNotNil: [\x0a\x09\x09\x09variables addAll: inspectedContext locals ] ].\x0a\x09\x0a\x09anInspector\x0a\x09\x09setLabel: 'Context';\x0a\x09\x09setVariables: variables",
  71. messageSends: ["new", "context", "addAll:", "locals", "whileTrue:", "outerContext", "ifNotNil:", "and:", "isBlockContext", "notNil", "setLabel:", "setVariables:"],
  72. referencedClasses: ["Dictionary"]
  73. }),
  74. smalltalk.HLContextInspectorDecorator);
  75. smalltalk.addMethod(
  76. smalltalk.method({
  77. selector: "on:",
  78. category: 'instance creation',
  79. fn: function (aContext){
  80. var self=this;
  81. return smalltalk.withContext(function($ctx1) {
  82. var $2,$3,$1;
  83. $2=self._new();
  84. _st($2)._initializeFromContext_(aContext);
  85. $3=_st($2)._yourself();
  86. $1=$3;
  87. return $1;
  88. }, function($ctx1) {$ctx1.fill(self,"on:",{aContext:aContext},smalltalk.HLContextInspectorDecorator.klass)})},
  89. args: ["aContext"],
  90. source: "on: aContext\x0a\x09^ self new\x0a\x09\x09initializeFromContext: aContext;\x0a\x09\x09yourself",
  91. messageSends: ["initializeFromContext:", "new", "yourself"],
  92. referencedClasses: []
  93. }),
  94. smalltalk.HLContextInspectorDecorator.klass);
  95. smalltalk.addClass('HLDebugger', smalltalk.HLFocusableWidget, ['model', 'stackListWidget', 'codeWidget', 'inspectorWidget'], 'Helios-Debugger');
  96. smalltalk.HLDebugger.comment="I am the main widget for the Helios debugger.";
  97. smalltalk.addMethod(
  98. smalltalk.method({
  99. selector: "codeWidget",
  100. category: 'accessing',
  101. fn: function (){
  102. var self=this;
  103. function $HLDebuggerCodeWidget(){return smalltalk.HLDebuggerCodeWidget||(typeof HLDebuggerCodeWidget=="undefined"?nil:HLDebuggerCodeWidget)}
  104. return smalltalk.withContext(function($ctx1) {
  105. var $2,$3,$4,$1;
  106. $2=self["@codeWidget"];
  107. if(($receiver = $2) == nil || $receiver == undefined){
  108. $3=_st($HLDebuggerCodeWidget())._new();
  109. _st($3)._browserModel_(self._model());
  110. $4=_st($3)._yourself();
  111. self["@codeWidget"]=$4;
  112. $1=self["@codeWidget"];
  113. } else {
  114. $1=$2;
  115. };
  116. return $1;
  117. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLDebugger)})},
  118. args: [],
  119. source: "codeWidget\x0a\x09^ codeWidget ifNil: [ codeWidget := HLDebuggerCodeWidget new\x0a\x09\x09browserModel: self model;\x0a\x09\x09yourself ]",
  120. messageSends: ["ifNil:", "browserModel:", "model", "new", "yourself"],
  121. referencedClasses: ["HLDebuggerCodeWidget"]
  122. }),
  123. smalltalk.HLDebugger);
  124. smalltalk.addMethod(
  125. smalltalk.method({
  126. selector: "focus",
  127. category: 'actions',
  128. fn: function (){
  129. var self=this;
  130. return smalltalk.withContext(function($ctx1) {
  131. _st(self._stackListWidget())._focus();
  132. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLDebugger)})},
  133. args: [],
  134. source: "focus\x0a\x09self stackListWidget focus",
  135. messageSends: ["focus", "stackListWidget"],
  136. referencedClasses: []
  137. }),
  138. smalltalk.HLDebugger);
  139. smalltalk.addMethod(
  140. smalltalk.method({
  141. selector: "initializeFromMethodContext:",
  142. category: 'accessing',
  143. fn: function (aMethodContext){
  144. var self=this;
  145. function $HLDebuggerModel(){return smalltalk.HLDebuggerModel||(typeof HLDebuggerModel=="undefined"?nil:HLDebuggerModel)}
  146. return smalltalk.withContext(function($ctx1) {
  147. self["@model"]=_st($HLDebuggerModel())._on_(aMethodContext);
  148. self._observeModel();
  149. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromMethodContext:",{aMethodContext:aMethodContext},smalltalk.HLDebugger)})},
  150. args: ["aMethodContext"],
  151. source: "initializeFromMethodContext: aMethodContext\x0a\x09model := HLDebuggerModel on: aMethodContext.\x0a\x09self observeModel",
  152. messageSends: ["on:", "observeModel"],
  153. referencedClasses: ["HLDebuggerModel"]
  154. }),
  155. smalltalk.HLDebugger);
  156. smalltalk.addMethod(
  157. smalltalk.method({
  158. selector: "inspectorWidget",
  159. category: 'accessing',
  160. fn: function (){
  161. var self=this;
  162. function $HLInspectorWidget(){return smalltalk.HLInspectorWidget||(typeof HLInspectorWidget=="undefined"?nil:HLInspectorWidget)}
  163. return smalltalk.withContext(function($ctx1) {
  164. var $2,$1;
  165. $2=self["@inspectorWidget"];
  166. if(($receiver = $2) == nil || $receiver == undefined){
  167. self["@inspectorWidget"]=_st($HLInspectorWidget())._new();
  168. $1=self["@inspectorWidget"];
  169. } else {
  170. $1=$2;
  171. };
  172. return $1;
  173. }, function($ctx1) {$ctx1.fill(self,"inspectorWidget",{},smalltalk.HLDebugger)})},
  174. args: [],
  175. source: "inspectorWidget\x0a\x09^ inspectorWidget ifNil: [ \x0a\x09\x09inspectorWidget := HLInspectorWidget new ]",
  176. messageSends: ["ifNil:", "new"],
  177. referencedClasses: ["HLInspectorWidget"]
  178. }),
  179. smalltalk.HLDebugger);
  180. smalltalk.addMethod(
  181. smalltalk.method({
  182. selector: "model",
  183. category: 'accessing',
  184. fn: function (){
  185. var self=this;
  186. function $HLDebuggerModel(){return smalltalk.HLDebuggerModel||(typeof HLDebuggerModel=="undefined"?nil:HLDebuggerModel)}
  187. return smalltalk.withContext(function($ctx1) {
  188. var $2,$1;
  189. $2=self["@model"];
  190. if(($receiver = $2) == nil || $receiver == undefined){
  191. self["@model"]=_st($HLDebuggerModel())._new();
  192. $1=self["@model"];
  193. } else {
  194. $1=$2;
  195. };
  196. return $1;
  197. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLDebugger)})},
  198. args: [],
  199. source: "model\x0a\x09^ model ifNil: [ model := HLDebuggerModel new ]",
  200. messageSends: ["ifNil:", "new"],
  201. referencedClasses: ["HLDebuggerModel"]
  202. }),
  203. smalltalk.HLDebugger);
  204. smalltalk.addMethod(
  205. smalltalk.method({
  206. selector: "observeModel",
  207. category: 'actions',
  208. fn: function (){
  209. var self=this;
  210. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  211. function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  212. return smalltalk.withContext(function($ctx1) {
  213. _st(_st(self._model())._announcer())._on_send_to_($HLDebuggerContextSelected(),"onContextSelected:",self);
  214. _st(_st(self._model())._announcer())._on_send_to_($HLDebuggerStepped(),"onContextSelected:",self);
  215. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLDebugger)})},
  216. args: [],
  217. source: "observeModel\x0a\x09self model announcer \x0a\x09\x09on: HLDebuggerContextSelected\x0a\x09\x09send: #onContextSelected:\x0a\x09\x09to: self.\x0a\x09\x09\x0a\x09self model announcer \x0a\x09\x09on: HLDebuggerStepped\x0a\x09\x09send: #onContextSelected:\x0a\x09\x09to: self",
  218. messageSends: ["on:send:to:", "announcer", "model"],
  219. referencedClasses: ["HLDebuggerContextSelected", "HLDebuggerStepped"]
  220. }),
  221. smalltalk.HLDebugger);
  222. smalltalk.addMethod(
  223. smalltalk.method({
  224. selector: "onContextSelected:",
  225. category: 'reactions',
  226. fn: function (anAnnouncement){
  227. var self=this;
  228. function $HLContextInspectorDecorator(){return smalltalk.HLContextInspectorDecorator||(typeof HLContextInspectorDecorator=="undefined"?nil:HLContextInspectorDecorator)}
  229. return smalltalk.withContext(function($ctx1) {
  230. _st(self._inspectorWidget())._inspect_(_st($HLContextInspectorDecorator())._on_(_st(anAnnouncement)._context()));
  231. return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLDebugger)})},
  232. args: ["anAnnouncement"],
  233. source: "onContextSelected: anAnnouncement\x0a\x09self inspectorWidget inspect: (HLContextInspectorDecorator on: anAnnouncement context)",
  234. messageSends: ["inspect:", "on:", "context", "inspectorWidget"],
  235. referencedClasses: ["HLContextInspectorDecorator"]
  236. }),
  237. smalltalk.HLDebugger);
  238. smalltalk.addMethod(
  239. smalltalk.method({
  240. selector: "registerBindingsOn:",
  241. category: 'keybindings',
  242. fn: function (aBindingGroup){
  243. var self=this;
  244. function $HLToolCommand(){return smalltalk.HLToolCommand||(typeof HLToolCommand=="undefined"?nil:HLToolCommand)}
  245. return smalltalk.withContext(function($ctx1) {
  246. _st($HLToolCommand())._registerConcreteClassesOn_for_(aBindingGroup,self._model());
  247. return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup},smalltalk.HLDebugger)})},
  248. args: ["aBindingGroup"],
  249. source: "registerBindingsOn: aBindingGroup\x0a\x09HLToolCommand \x0a\x09\x09registerConcreteClassesOn: aBindingGroup \x0a\x09\x09for: self model",
  250. messageSends: ["registerConcreteClassesOn:for:", "model"],
  251. referencedClasses: ["HLToolCommand"]
  252. }),
  253. smalltalk.HLDebugger);
  254. smalltalk.addMethod(
  255. smalltalk.method({
  256. selector: "renderContentOn:",
  257. category: 'rendering',
  258. fn: function (html){
  259. var self=this;
  260. function $HLVerticalSplitter(){return smalltalk.HLVerticalSplitter||(typeof HLVerticalSplitter=="undefined"?nil:HLVerticalSplitter)}
  261. function $HLHorizontalSplitter(){return smalltalk.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  262. function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  263. return smalltalk.withContext(function($ctx1) {
  264. _st(html)._with_(_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(self._stackListWidget(),_st($HLVerticalSplitter())._with_with_(self._codeWidget(),self._inspectorWidget()))));
  265. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLDebugger)})},
  266. args: ["html"],
  267. source: "renderContentOn: html\x0a\x09html with: (HLContainer with: (HLHorizontalSplitter\x0a\x09\x09with: self stackListWidget\x0a\x09\x09with: (HLVerticalSplitter\x0a\x09\x09\x09with: self codeWidget\x0a\x09\x09\x09with: self inspectorWidget)))",
  268. messageSends: ["with:", "with:with:", "stackListWidget", "codeWidget", "inspectorWidget"],
  269. referencedClasses: ["HLVerticalSplitter", "HLHorizontalSplitter", "HLContainer"]
  270. }),
  271. smalltalk.HLDebugger);
  272. smalltalk.addMethod(
  273. smalltalk.method({
  274. selector: "stackListWidget",
  275. category: 'accessing',
  276. fn: function (){
  277. var self=this;
  278. function $HLStackListWidget(){return smalltalk.HLStackListWidget||(typeof HLStackListWidget=="undefined"?nil:HLStackListWidget)}
  279. return smalltalk.withContext(function($ctx1) {
  280. var $2,$3,$4,$1;
  281. $2=self["@stackListWidget"];
  282. if(($receiver = $2) == nil || $receiver == undefined){
  283. $3=_st($HLStackListWidget())._on_(self._model());
  284. _st($3)._next_(self._codeWidget());
  285. $4=_st($3)._yourself();
  286. self["@stackListWidget"]=$4;
  287. $1=self["@stackListWidget"];
  288. } else {
  289. $1=$2;
  290. };
  291. return $1;
  292. }, function($ctx1) {$ctx1.fill(self,"stackListWidget",{},smalltalk.HLDebugger)})},
  293. args: [],
  294. source: "stackListWidget\x0a\x09^ stackListWidget ifNil: [ \x0a\x09\x09stackListWidget := (HLStackListWidget on: self model)\x0a\x09\x09\x09next: self codeWidget;\x0a\x09\x09\x09yourself ]",
  295. messageSends: ["ifNil:", "next:", "codeWidget", "on:", "model", "yourself"],
  296. referencedClasses: ["HLStackListWidget"]
  297. }),
  298. smalltalk.HLDebugger);
  299. smalltalk.addMethod(
  300. smalltalk.method({
  301. selector: "unregister",
  302. category: 'actions',
  303. fn: function (){
  304. var self=this;
  305. return smalltalk.withContext(function($ctx1) {
  306. smalltalk.HLFocusableWidget.fn.prototype._unregister.apply(_st(self), []);
  307. _st(self._inspectorWidget())._unregister();
  308. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLDebugger)})},
  309. args: [],
  310. source: "unregister\x0a\x09super unregister.\x0a\x09self inspectorWidget unregister",
  311. messageSends: ["unregister", "inspectorWidget"],
  312. referencedClasses: []
  313. }),
  314. smalltalk.HLDebugger);
  315. smalltalk.addMethod(
  316. smalltalk.method({
  317. selector: "on:",
  318. category: 'instance creation',
  319. fn: function (aMethodContext){
  320. var self=this;
  321. return smalltalk.withContext(function($ctx1) {
  322. var $2,$3,$1;
  323. $2=self._new();
  324. _st($2)._initializeFromMethodContext_(aMethodContext);
  325. $3=_st($2)._yourself();
  326. $1=$3;
  327. return $1;
  328. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},smalltalk.HLDebugger.klass)})},
  329. args: ["aMethodContext"],
  330. source: "on: aMethodContext\x0a\x09^ self new\x0a\x09\x09initializeFromMethodContext: aMethodContext;\x0a\x09\x09yourself",
  331. messageSends: ["initializeFromMethodContext:", "new", "yourself"],
  332. referencedClasses: []
  333. }),
  334. smalltalk.HLDebugger.klass);
  335. smalltalk.addMethod(
  336. smalltalk.method({
  337. selector: "tabClass",
  338. category: 'accessing',
  339. fn: function (){
  340. var self=this;
  341. return smalltalk.withContext(function($ctx1) {
  342. return "debugger";
  343. }, function($ctx1) {$ctx1.fill(self,"tabClass",{},smalltalk.HLDebugger.klass)})},
  344. args: [],
  345. source: "tabClass\x0a\x09^ 'debugger'",
  346. messageSends: [],
  347. referencedClasses: []
  348. }),
  349. smalltalk.HLDebugger.klass);
  350. smalltalk.addMethod(
  351. smalltalk.method({
  352. selector: "tabLabel",
  353. category: 'accessing',
  354. fn: function (){
  355. var self=this;
  356. return smalltalk.withContext(function($ctx1) {
  357. return "Debugger";
  358. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLDebugger.klass)})},
  359. args: [],
  360. source: "tabLabel\x0a\x09^ 'Debugger'",
  361. messageSends: [],
  362. referencedClasses: []
  363. }),
  364. smalltalk.HLDebugger.klass);
  365. smalltalk.addClass('HLDebuggerCodeWidget', smalltalk.HLBrowserCodeWidget, ['highlightedNode'], 'Helios-Debugger');
  366. smalltalk.addMethod(
  367. smalltalk.method({
  368. selector: "addStopAt:",
  369. category: 'actions',
  370. fn: function (anInteger){
  371. var self=this;
  372. return smalltalk.withContext(function($ctx1) {
  373. _st(self["@editor"])._setGutterMarker_gutter_value_(anInteger,"stops",_st(_st("<div class=\x22stop\x22></stop>"._asJQuery())._toArray())._first());
  374. return self}, function($ctx1) {$ctx1.fill(self,"addStopAt:",{anInteger:anInteger},smalltalk.HLDebuggerCodeWidget)})},
  375. args: ["anInteger"],
  376. source: "addStopAt: anInteger\x0a\x09editor\x0a\x09\x09setGutterMarker: anInteger\x0a\x09\x09gutter: 'stops'\x0a\x09\x09value: '<div class=\x22stop\x22></stop>' asJQuery toArray first",
  377. messageSends: ["setGutterMarker:gutter:value:", "first", "toArray", "asJQuery"],
  378. referencedClasses: []
  379. }),
  380. smalltalk.HLDebuggerCodeWidget);
  381. smalltalk.addMethod(
  382. smalltalk.method({
  383. selector: "clearHighlight",
  384. category: 'actions',
  385. fn: function (){
  386. var self=this;
  387. return smalltalk.withContext(function($ctx1) {
  388. var $1;
  389. _st(self["@editor"])._clearGutter_("stops");
  390. $1=self._highlightedNode();
  391. if(($receiver = $1) == nil || $receiver == undefined){
  392. $1;
  393. } else {
  394. var node;
  395. node=$receiver;
  396. _st(self["@editor"])._removeLineClass_where_class_(_st(_st(_st(node)._position())._x()).__minus((1)),"background","highlighted");
  397. };
  398. return self}, function($ctx1) {$ctx1.fill(self,"clearHighlight",{},smalltalk.HLDebuggerCodeWidget)})},
  399. args: [],
  400. source: "clearHighlight\x0a\x09editor clearGutter: 'stops'.\x0a\x09self highlightedNode ifNotNil: [ :node |\x0a\x09\x09editor \x0a\x09\x09\x09removeLineClass: node position x - 1\x0a\x09\x09\x09where: 'background'\x0a\x09\x09\x09class: 'highlighted' ]",
  401. messageSends: ["clearGutter:", "ifNotNil:", "removeLineClass:where:class:", "-", "x", "position", "highlightedNode"],
  402. referencedClasses: []
  403. }),
  404. smalltalk.HLDebuggerCodeWidget);
  405. smalltalk.addMethod(
  406. smalltalk.method({
  407. selector: "contents:",
  408. category: 'accessing',
  409. fn: function (aString){
  410. var self=this;
  411. return smalltalk.withContext(function($ctx1) {
  412. self._clearHighlight();
  413. smalltalk.HLBrowserCodeWidget.fn.prototype._contents_.apply(_st(self), [aString]);
  414. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLDebuggerCodeWidget)})},
  415. args: ["aString"],
  416. source: "contents: aString\x0a\x09self clearHighlight.\x0a\x09super contents: aString",
  417. messageSends: ["clearHighlight", "contents:"],
  418. referencedClasses: []
  419. }),
  420. smalltalk.HLDebuggerCodeWidget);
  421. smalltalk.addMethod(
  422. smalltalk.method({
  423. selector: "editorOptions",
  424. category: 'accessing',
  425. fn: function (){
  426. var self=this;
  427. return smalltalk.withContext(function($ctx1) {
  428. var $2,$3,$1;
  429. $2=smalltalk.HLBrowserCodeWidget.fn.prototype._editorOptions.apply(_st(self), []);
  430. _st($2)._at_put_("gutters",["CodeMirror-linenumbers", "stops"]);
  431. $3=_st($2)._yourself();
  432. $1=$3;
  433. return $1;
  434. }, function($ctx1) {$ctx1.fill(self,"editorOptions",{},smalltalk.HLDebuggerCodeWidget)})},
  435. args: [],
  436. source: "editorOptions\x0a\x09^ super editorOptions\x0a\x09\x09at: 'gutters' put: #('CodeMirror-linenumbers' 'stops');\x0a\x09\x09yourself",
  437. messageSends: ["at:put:", "editorOptions", "yourself"],
  438. referencedClasses: []
  439. }),
  440. smalltalk.HLDebuggerCodeWidget);
  441. smalltalk.addMethod(
  442. smalltalk.method({
  443. selector: "highlight",
  444. category: 'actions',
  445. fn: function (){
  446. var self=this;
  447. var anchor,head,selection;
  448. return smalltalk.withContext(function($ctx1) {
  449. head=smalltalk.HashedCollection._fromPairs_(["line".__minus_gt(_st(_st(_st(self._highlightedNode())._position())._x()).__minus((1))),"ch".__minus_gt(_st(_st(_st(self._highlightedNode())._position())._y()).__minus((1)))]);
  450. anchor=smalltalk.HashedCollection._fromPairs_(["line".__minus_gt(_st(_st(_st(self._highlightedNode())._extent())._x()).__minus((1))),"ch".__minus_gt(_st(_st(_st(self._highlightedNode())._extent())._y()).__minus((1)))]);
  451. _st(self["@editor"])._setSelection_to_(head,anchor);
  452. return self}, function($ctx1) {$ctx1.fill(self,"highlight",{anchor:anchor,head:head,selection:selection},smalltalk.HLDebuggerCodeWidget)})},
  453. args: [],
  454. source: "highlight\x0a\x09| anchor head selection |\x0a\x09\x0a\x09head := #{\x0a\x09\x09'line' -> (self highlightedNode position x - 1).\x0a\x09\x09'ch' -> (self highlightedNode position y - 1)\x0a\x09}.\x0a\x09\x0a\x09anchor := #{\x0a\x09\x09'line' -> (self highlightedNode extent x - 1).\x0a\x09\x09'ch' -> (self highlightedNode extent y - 1)\x0a\x09}.\x0a\x09\x0a\x09editor setSelection: head to: anchor",
  455. messageSends: ["->", "-", "x", "position", "highlightedNode", "y", "extent", "setSelection:to:"],
  456. referencedClasses: []
  457. }),
  458. smalltalk.HLDebuggerCodeWidget);
  459. smalltalk.addMethod(
  460. smalltalk.method({
  461. selector: "highlightLine:",
  462. category: 'actions',
  463. fn: function (anInteger){
  464. var self=this;
  465. return smalltalk.withContext(function($ctx1) {
  466. _st(self["@editor"])._addLineClass_where_class_(anInteger,"background","highlighted");
  467. return self}, function($ctx1) {$ctx1.fill(self,"highlightLine:",{anInteger:anInteger},smalltalk.HLDebuggerCodeWidget)})},
  468. args: ["anInteger"],
  469. source: "highlightLine: anInteger\x0a\x09editor \x0a\x09\x09addLineClass: anInteger\x0a\x09\x09where: 'background'\x0a\x09\x09class: 'highlighted'",
  470. messageSends: ["addLineClass:where:class:"],
  471. referencedClasses: []
  472. }),
  473. smalltalk.HLDebuggerCodeWidget);
  474. smalltalk.addMethod(
  475. smalltalk.method({
  476. selector: "highlightNode:",
  477. category: 'actions',
  478. fn: function (aNode){
  479. var self=this;
  480. var line;
  481. return smalltalk.withContext(function($ctx1) {
  482. var $1,$2,$3;
  483. $1=aNode;
  484. if(($receiver = $1) == nil || $receiver == undefined){
  485. $1;
  486. } else {
  487. line=_st(_st(_st(aNode)._position())._x()).__minus((1));
  488. line;
  489. $2=self;
  490. _st($2)._clearHighlight();
  491. _st($2)._addStopAt_(line);
  492. _st($2)._highlightLine_(line);
  493. $3=_st($2)._highlightedNode_(aNode);
  494. $3;
  495. };
  496. return self}, function($ctx1) {$ctx1.fill(self,"highlightNode:",{aNode:aNode,line:line},smalltalk.HLDebuggerCodeWidget)})},
  497. args: ["aNode"],
  498. source: "highlightNode: aNode\x0a\x09| line |\x0a\x09aNode ifNotNil: [\x0a\x09\x09line := aNode position x - 1.\x0a\x09\x09self \x0a\x09\x09\x09clearHighlight; \x0a\x09\x09\x09addStopAt: line;\x0a\x09\x09\x09highlightLine: line;\x0a\x09\x09\x09highlightedNode: aNode\x0a\x09\x09]",
  499. messageSends: ["ifNotNil:", "-", "x", "position", "clearHighlight", "addStopAt:", "highlightLine:", "highlightedNode:"],
  500. referencedClasses: []
  501. }),
  502. smalltalk.HLDebuggerCodeWidget);
  503. smalltalk.addMethod(
  504. smalltalk.method({
  505. selector: "highlightedNode",
  506. category: 'accessing',
  507. fn: function (){
  508. var self=this;
  509. return smalltalk.withContext(function($ctx1) {
  510. var $1;
  511. $1=self["@highlightedNode"];
  512. return $1;
  513. }, function($ctx1) {$ctx1.fill(self,"highlightedNode",{},smalltalk.HLDebuggerCodeWidget)})},
  514. args: [],
  515. source: "highlightedNode\x0a\x09^ highlightedNode",
  516. messageSends: [],
  517. referencedClasses: []
  518. }),
  519. smalltalk.HLDebuggerCodeWidget);
  520. smalltalk.addMethod(
  521. smalltalk.method({
  522. selector: "highlightedNode:",
  523. category: 'accessing',
  524. fn: function (aNode){
  525. var self=this;
  526. return smalltalk.withContext(function($ctx1) {
  527. self["@highlightedNode"]=aNode;
  528. return self}, function($ctx1) {$ctx1.fill(self,"highlightedNode:",{aNode:aNode},smalltalk.HLDebuggerCodeWidget)})},
  529. args: ["aNode"],
  530. source: "highlightedNode: aNode\x0a\x09highlightedNode := aNode",
  531. messageSends: [],
  532. referencedClasses: []
  533. }),
  534. smalltalk.HLDebuggerCodeWidget);
  535. smalltalk.addMethod(
  536. smalltalk.method({
  537. selector: "observeBrowserModel",
  538. category: 'actions',
  539. fn: function (){
  540. var self=this;
  541. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  542. function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  543. return smalltalk.withContext(function($ctx1) {
  544. smalltalk.HLBrowserCodeWidget.fn.prototype._observeBrowserModel.apply(_st(self), []);
  545. _st(_st(self._browserModel())._announcer())._on_send_to_($HLDebuggerContextSelected(),"onContextSelected",self);
  546. _st(_st(self._browserModel())._announcer())._on_send_to_($HLDebuggerStepped(),"onContextSelected",self);
  547. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLDebuggerCodeWidget)})},
  548. args: [],
  549. source: "observeBrowserModel\x0a\x09super observeBrowserModel.\x0a\x09\x0a\x09self browserModel announcer \x0a\x09\x09on: HLDebuggerContextSelected\x0a\x09\x09send: #onContextSelected\x0a\x09\x09to: self.\x0a\x09\x0a\x09self browserModel announcer \x0a\x09\x09on: HLDebuggerStepped\x0a\x09\x09send: #onContextSelected\x0a\x09\x09to: self",
  550. messageSends: ["observeBrowserModel", "on:send:to:", "announcer", "browserModel"],
  551. referencedClasses: ["HLDebuggerContextSelected", "HLDebuggerStepped"]
  552. }),
  553. smalltalk.HLDebuggerCodeWidget);
  554. smalltalk.addMethod(
  555. smalltalk.method({
  556. selector: "onContextSelected",
  557. category: 'reactions',
  558. fn: function (){
  559. var self=this;
  560. return smalltalk.withContext(function($ctx1) {
  561. self._highlightNode_(_st(self._browserModel())._nextNode());
  562. return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected",{},smalltalk.HLDebuggerCodeWidget)})},
  563. args: [],
  564. source: "onContextSelected\x0a\x09self highlightNode: self browserModel nextNode",
  565. messageSends: ["highlightNode:", "nextNode", "browserModel"],
  566. referencedClasses: []
  567. }),
  568. smalltalk.HLDebuggerCodeWidget);
  569. smalltalk.addClass('HLDebuggerModel', smalltalk.HLToolModel, ['rootContext', 'currentContext', 'contexts'], 'Helios-Debugger');
  570. smalltalk.HLDebuggerModel.comment="I am a model for Helios debugging.\x0a\x0aMy instances hold a reference to an `AIContext` instance, built from a `MethodContext`. The context should be the root of the context stack.";
  571. smalltalk.addMethod(
  572. smalltalk.method({
  573. selector: "contexts",
  574. category: 'accessing',
  575. fn: function (){
  576. var self=this;
  577. return smalltalk.withContext(function($ctx1) {
  578. var $1;
  579. $1=self["@contexts"];
  580. return $1;
  581. }, function($ctx1) {$ctx1.fill(self,"contexts",{},smalltalk.HLDebuggerModel)})},
  582. args: [],
  583. source: "contexts\x0a\x09^ contexts",
  584. messageSends: [],
  585. referencedClasses: []
  586. }),
  587. smalltalk.HLDebuggerModel);
  588. smalltalk.addMethod(
  589. smalltalk.method({
  590. selector: "currentContext",
  591. category: 'accessing',
  592. fn: function (){
  593. var self=this;
  594. return smalltalk.withContext(function($ctx1) {
  595. var $1,$2;
  596. $1=self["@currentContext"];
  597. if(($receiver = $1) == nil || $receiver == undefined){
  598. self._currentContext_(self._rootContext());
  599. } else {
  600. $1;
  601. };
  602. $2=self["@currentContext"];
  603. return $2;
  604. }, function($ctx1) {$ctx1.fill(self,"currentContext",{},smalltalk.HLDebuggerModel)})},
  605. args: [],
  606. source: "currentContext\x0a\x09currentContext ifNil: [ self currentContext: self rootContext ].\x0a\x09^ currentContext",
  607. messageSends: ["ifNil:", "currentContext:", "rootContext"],
  608. referencedClasses: []
  609. }),
  610. smalltalk.HLDebuggerModel);
  611. smalltalk.addMethod(
  612. smalltalk.method({
  613. selector: "currentContext:",
  614. category: 'accessing',
  615. fn: function (aContext){
  616. var self=this;
  617. function $ASTDebugger(){return smalltalk.ASTDebugger||(typeof ASTDebugger=="undefined"?nil:ASTDebugger)}
  618. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  619. return smalltalk.withContext(function($ctx1) {
  620. var $1,$2;
  621. self._withChangesDo_((function(){
  622. return smalltalk.withContext(function($ctx2) {
  623. self._selectedMethod_(_st(aContext)._method());
  624. self["@currentContext"]=aContext;
  625. self["@currentContext"];
  626. self["@interpreter"]=_st($ASTDebugger())._context_(aContext);
  627. self["@interpreter"];
  628. $1=_st($HLDebuggerContextSelected())._new();
  629. _st($1)._context_(aContext);
  630. $2=_st($1)._yourself();
  631. return _st(self._announcer())._announce_($2);
  632. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  633. return self}, function($ctx1) {$ctx1.fill(self,"currentContext:",{aContext:aContext},smalltalk.HLDebuggerModel)})},
  634. args: ["aContext"],
  635. source: "currentContext: aContext\x0a\x09self withChangesDo: [ \x0a\x09\x09self selectedMethod: aContext method.\x0a\x09\x09currentContext := aContext.\x0a\x09\x09interpreter := ASTDebugger context: aContext.\x0a\x09\x09self announcer announce: (HLDebuggerContextSelected new\x0a\x09\x09\x09context: aContext;\x0a\x09\x09\x09yourself) ]",
  636. messageSends: ["withChangesDo:", "selectedMethod:", "method", "context:", "announce:", "new", "yourself", "announcer"],
  637. referencedClasses: ["ASTDebugger", "HLDebuggerContextSelected"]
  638. }),
  639. smalltalk.HLDebuggerModel);
  640. smalltalk.addMethod(
  641. smalltalk.method({
  642. selector: "initializeContexts",
  643. category: 'initialization',
  644. fn: function (){
  645. var self=this;
  646. var context;
  647. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  648. return smalltalk.withContext(function($ctx1) {
  649. self["@contexts"]=_st($OrderedCollection())._new();
  650. context=self._rootContext();
  651. _st((function(){
  652. return smalltalk.withContext(function($ctx2) {
  653. return _st(context)._notNil();
  654. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  655. return smalltalk.withContext(function($ctx2) {
  656. _st(self["@contexts"])._add_(context);
  657. context=_st(context)._outerContext();
  658. return context;
  659. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  660. return self}, function($ctx1) {$ctx1.fill(self,"initializeContexts",{context:context},smalltalk.HLDebuggerModel)})},
  661. args: [],
  662. source: "initializeContexts\x0a\x09\x22Flatten the context stack into an OrderedCollection\x22\x0a\x09\x0a\x09| context |\x0a\x09\x0a\x09contexts := OrderedCollection new.\x0a\x09context := self rootContext.\x0a\x09\x0a\x09[ context notNil ] whileTrue: [\x0a\x09\x09contexts add: context.\x0a\x09\x09context := context outerContext ]",
  663. messageSends: ["new", "rootContext", "whileTrue:", "add:", "outerContext", "notNil"],
  664. referencedClasses: ["OrderedCollection"]
  665. }),
  666. smalltalk.HLDebuggerModel);
  667. smalltalk.addMethod(
  668. smalltalk.method({
  669. selector: "initializeFromContext:",
  670. category: 'initialization',
  671. fn: function (aMethodContext){
  672. var self=this;
  673. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  674. return smalltalk.withContext(function($ctx1) {
  675. self["@rootContext"]=_st($AIContext())._fromMethodContext_(aMethodContext);
  676. self._initializeContexts();
  677. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromContext:",{aMethodContext:aMethodContext},smalltalk.HLDebuggerModel)})},
  678. args: ["aMethodContext"],
  679. source: "initializeFromContext: aMethodContext\x0a\x09rootContext := AIContext fromMethodContext: aMethodContext.\x0a\x09self initializeContexts",
  680. messageSends: ["fromMethodContext:", "initializeContexts"],
  681. referencedClasses: ["AIContext"]
  682. }),
  683. smalltalk.HLDebuggerModel);
  684. smalltalk.addMethod(
  685. smalltalk.method({
  686. selector: "interpreter",
  687. category: 'accessing',
  688. fn: function (){
  689. var self=this;
  690. return smalltalk.withContext(function($ctx1) {
  691. var $1;
  692. $1=_st(self._currentContext())._interpreter();
  693. return $1;
  694. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.HLDebuggerModel)})},
  695. args: [],
  696. source: "interpreter\x0a\x09^ self currentContext interpreter",
  697. messageSends: ["interpreter", "currentContext"],
  698. referencedClasses: []
  699. }),
  700. smalltalk.HLDebuggerModel);
  701. smalltalk.addMethod(
  702. smalltalk.method({
  703. selector: "nextNode",
  704. category: 'accessing',
  705. fn: function (){
  706. var self=this;
  707. return smalltalk.withContext(function($ctx1) {
  708. var $1;
  709. $1=_st(self._interpreter())._node();
  710. return $1;
  711. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.HLDebuggerModel)})},
  712. args: [],
  713. source: "nextNode\x0a\x09^ self interpreter node",
  714. messageSends: ["node", "interpreter"],
  715. referencedClasses: []
  716. }),
  717. smalltalk.HLDebuggerModel);
  718. smalltalk.addMethod(
  719. smalltalk.method({
  720. selector: "restart",
  721. category: 'actions',
  722. fn: function (){
  723. var self=this;
  724. function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  725. return smalltalk.withContext(function($ctx1) {
  726. var $1,$2;
  727. _st(self._interpreter())._restart();
  728. $1=_st($HLDebuggerStepped())._new();
  729. _st($1)._context_(self._currentContext());
  730. $2=_st($1)._yourself();
  731. _st(self._announcer())._announce_($2);
  732. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.HLDebuggerModel)})},
  733. args: [],
  734. source: "restart\x0a\x09self interpreter restart.\x0a\x09self announcer announce: (HLDebuggerStepped new\x0a\x09\x09context: self currentContext;\x0a\x09\x09yourself)",
  735. messageSends: ["restart", "interpreter", "announce:", "announcer", "context:", "new", "currentContext", "yourself"],
  736. referencedClasses: ["HLDebuggerStepped"]
  737. }),
  738. smalltalk.HLDebuggerModel);
  739. smalltalk.addMethod(
  740. smalltalk.method({
  741. selector: "rootContext",
  742. category: 'accessing',
  743. fn: function (){
  744. var self=this;
  745. return smalltalk.withContext(function($ctx1) {
  746. var $1;
  747. $1=self["@rootContext"];
  748. return $1;
  749. }, function($ctx1) {$ctx1.fill(self,"rootContext",{},smalltalk.HLDebuggerModel)})},
  750. args: [],
  751. source: "rootContext\x0a\x09^ rootContext",
  752. messageSends: [],
  753. referencedClasses: []
  754. }),
  755. smalltalk.HLDebuggerModel);
  756. smalltalk.addMethod(
  757. smalltalk.method({
  758. selector: "stepOver",
  759. category: 'actions',
  760. fn: function (){
  761. var self=this;
  762. function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  763. return smalltalk.withContext(function($ctx1) {
  764. var $1,$2;
  765. _st(self._interpreter())._stepOver();
  766. $1=_st($HLDebuggerStepped())._new();
  767. _st($1)._context_(self._currentContext());
  768. $2=_st($1)._yourself();
  769. _st(self._announcer())._announce_($2);
  770. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.HLDebuggerModel)})},
  771. args: [],
  772. source: "stepOver\x0a\x09self interpreter stepOver.\x0a\x09self announcer announce: (HLDebuggerStepped new\x0a\x09\x09context: self currentContext;\x0a\x09\x09yourself)",
  773. messageSends: ["stepOver", "interpreter", "announce:", "announcer", "context:", "new", "currentContext", "yourself"],
  774. referencedClasses: ["HLDebuggerStepped"]
  775. }),
  776. smalltalk.HLDebuggerModel);
  777. smalltalk.addMethod(
  778. smalltalk.method({
  779. selector: "on:",
  780. category: 'instance creation',
  781. fn: function (aMethodContext){
  782. var self=this;
  783. return smalltalk.withContext(function($ctx1) {
  784. var $2,$3,$1;
  785. $2=self._new();
  786. _st($2)._initializeFromContext_(aMethodContext);
  787. $3=_st($2)._yourself();
  788. $1=$3;
  789. return $1;
  790. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},smalltalk.HLDebuggerModel.klass)})},
  791. args: ["aMethodContext"],
  792. source: "on: aMethodContext\x0a\x09^ self new\x0a\x09\x09initializeFromContext: aMethodContext;\x0a\x09\x09yourself",
  793. messageSends: ["initializeFromContext:", "new", "yourself"],
  794. referencedClasses: []
  795. }),
  796. smalltalk.HLDebuggerModel.klass);
  797. smalltalk.addClass('HLErrorHandler', smalltalk.ErrorHandler, [], 'Helios-Debugger');
  798. smalltalk.addMethod(
  799. smalltalk.method({
  800. selector: "handleError:",
  801. category: 'error handling',
  802. fn: function (anError){
  803. var self=this;
  804. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  805. function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  806. function $HLDebugger(){return smalltalk.HLDebugger||(typeof HLDebugger=="undefined"?nil:HLDebugger)}
  807. return smalltalk.withContext(function($ctx1) {
  808. self._onErrorHandled();
  809. _st((function(){
  810. return smalltalk.withContext(function($ctx2) {
  811. return _st(_st($HLDebugger())._on_(_st(anError)._context()))._openAsTab();
  812. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(error){
  813. return smalltalk.withContext(function($ctx2) {
  814. return _st(_st($ErrorHandler())._new())._handleError_(error);
  815. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1)})}));
  816. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.HLErrorHandler)})},
  817. args: ["anError"],
  818. source: "handleError: anError\x0a\x09self onErrorHandled.\x0a\x0a\x09[ \x0a\x09\x09(HLDebugger on: anError context) openAsTab \x0a\x09] \x0a\x09\x09on: Error \x0a\x09\x09do: [ :error | ErrorHandler new handleError: error ]",
  819. messageSends: ["onErrorHandled", "on:do:", "handleError:", "new", "openAsTab", "on:", "context"],
  820. referencedClasses: ["Error", "ErrorHandler", "HLDebugger"]
  821. }),
  822. smalltalk.HLErrorHandler);
  823. smalltalk.addMethod(
  824. smalltalk.method({
  825. selector: "onErrorHandled",
  826. category: 'error handling',
  827. fn: function (){
  828. var self=this;
  829. function $HLProgressWidget(){return smalltalk.HLProgressWidget||(typeof HLProgressWidget=="undefined"?nil:HLProgressWidget)}
  830. return smalltalk.withContext(function($ctx1) {
  831. var $1,$2;
  832. $1=_st($HLProgressWidget())._default();
  833. _st($1)._flush();
  834. $2=_st($1)._remove();
  835. return self}, function($ctx1) {$ctx1.fill(self,"onErrorHandled",{},smalltalk.HLErrorHandler)})},
  836. args: [],
  837. source: "onErrorHandled\x0a\x09\x22when an error is handled, we need to make sure that\x0a\x09any progress bar widget gets removed. Because HLProgressBarWidget is asynchronous,\x0a\x09it has to be done here.\x22\x0a\x09\x0a\x09HLProgressWidget default \x0a\x09\x09flush; \x0a\x09\x09remove",
  838. messageSends: ["flush", "default", "remove"],
  839. referencedClasses: ["HLProgressWidget"]
  840. }),
  841. smalltalk.HLErrorHandler);
  842. smalltalk.addMethod(
  843. smalltalk.method({
  844. selector: "handleError:",
  845. category: 'error handling',
  846. fn: function (anError){
  847. var self=this;
  848. return smalltalk.withContext(function($ctx1) {
  849. var $1;
  850. $1=_st(self._new())._handleError_(anError);
  851. return $1;
  852. }, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.HLErrorHandler.klass)})},
  853. args: ["anError"],
  854. source: "handleError: anError\x0a\x09^ self new handleError: anError",
  855. messageSends: ["handleError:", "new"],
  856. referencedClasses: []
  857. }),
  858. smalltalk.HLErrorHandler.klass);
  859. smalltalk.addClass('HLStackListWidget', smalltalk.HLToolListWidget, [], 'Helios-Debugger');
  860. smalltalk.addMethod(
  861. smalltalk.method({
  862. selector: "items",
  863. category: 'accessing',
  864. fn: function (){
  865. var self=this;
  866. return smalltalk.withContext(function($ctx1) {
  867. var $2,$1;
  868. $2=self["@items"];
  869. if(($receiver = $2) == nil || $receiver == undefined){
  870. self["@items"]=_st(self._model())._contexts();
  871. $1=self["@items"];
  872. } else {
  873. $1=$2;
  874. };
  875. return $1;
  876. }, function($ctx1) {$ctx1.fill(self,"items",{},smalltalk.HLStackListWidget)})},
  877. args: [],
  878. source: "items\x0a\x09^ items ifNil: [ items := self model contexts ]",
  879. messageSends: ["ifNil:", "contexts", "model"],
  880. referencedClasses: []
  881. }),
  882. smalltalk.HLStackListWidget);
  883. smalltalk.addMethod(
  884. smalltalk.method({
  885. selector: "label",
  886. category: 'accessing',
  887. fn: function (){
  888. var self=this;
  889. return smalltalk.withContext(function($ctx1) {
  890. return "Call stack";
  891. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLStackListWidget)})},
  892. args: [],
  893. source: "label\x0a\x09^ 'Call stack'",
  894. messageSends: [],
  895. referencedClasses: []
  896. }),
  897. smalltalk.HLStackListWidget);
  898. smalltalk.addMethod(
  899. smalltalk.method({
  900. selector: "renderButtonsOn:",
  901. category: 'rendering',
  902. fn: function (html){
  903. var self=this;
  904. return smalltalk.withContext(function($ctx1) {
  905. var $1,$3,$4,$5,$6,$2;
  906. $1=_st(html)._div();
  907. _st($1)._class_("debugger_bar");
  908. $2=_st($1)._with_((function(){
  909. return smalltalk.withContext(function($ctx2) {
  910. $3=_st(html)._button();
  911. _st($3)._class_("btn restart");
  912. _st($3)._with_("Restart");
  913. $4=_st($3)._onClick_((function(){
  914. return smalltalk.withContext(function($ctx3) {
  915. return self._restart();
  916. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  917. $4;
  918. $5=_st(html)._button();
  919. _st($5)._class_("btn stepOver");
  920. _st($5)._with_("Step over");
  921. $6=_st($5)._onClick_((function(){
  922. return smalltalk.withContext(function($ctx3) {
  923. return self._stepOver();
  924. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  925. return $6;
  926. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  927. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLStackListWidget)})},
  928. args: ["html"],
  929. source: "renderButtonsOn: html\x0a\x09html div \x0a\x09\x09class: 'debugger_bar'; \x0a\x09\x09with: [\x0a\x09\x09\x09html button \x0a\x09\x09\x09\x09class: 'btn restart';\x0a\x09\x09\x09\x09with: 'Restart';\x0a\x09\x09\x09\x09onClick: [ self restart ].\x0a\x09\x09\x09html button \x0a\x09\x09\x09\x09class: 'btn stepOver';\x0a\x09\x09\x09\x09with: 'Step over';\x0a\x09\x09\x09\x09onClick: [ self stepOver ] ]",
  930. messageSends: ["class:", "div", "with:", "button", "onClick:", "restart", "stepOver"],
  931. referencedClasses: []
  932. }),
  933. smalltalk.HLStackListWidget);
  934. smalltalk.addMethod(
  935. smalltalk.method({
  936. selector: "restart",
  937. category: 'actions',
  938. fn: function (){
  939. var self=this;
  940. return smalltalk.withContext(function($ctx1) {
  941. _st(self._model())._restart();
  942. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.HLStackListWidget)})},
  943. args: [],
  944. source: "restart\x0a\x09self model restart",
  945. messageSends: ["restart", "model"],
  946. referencedClasses: []
  947. }),
  948. smalltalk.HLStackListWidget);
  949. smalltalk.addMethod(
  950. smalltalk.method({
  951. selector: "selectItem:",
  952. category: 'actions',
  953. fn: function (aContext){
  954. var self=this;
  955. return smalltalk.withContext(function($ctx1) {
  956. _st(self._model())._currentContext_(aContext);
  957. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{aContext:aContext},smalltalk.HLStackListWidget)})},
  958. args: ["aContext"],
  959. source: "selectItem: aContext\x0a \x09self model currentContext: aContext",
  960. messageSends: ["currentContext:", "model"],
  961. referencedClasses: []
  962. }),
  963. smalltalk.HLStackListWidget);
  964. smalltalk.addMethod(
  965. smalltalk.method({
  966. selector: "stepOver",
  967. category: 'actions',
  968. fn: function (){
  969. var self=this;
  970. return smalltalk.withContext(function($ctx1) {
  971. _st(self._model())._stepOver();
  972. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.HLStackListWidget)})},
  973. args: [],
  974. source: "stepOver\x0a\x09self model stepOver",
  975. messageSends: ["stepOver", "model"],
  976. referencedClasses: []
  977. }),
  978. smalltalk.HLStackListWidget);