Helios-Debugger.deploy.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. smalltalk.addPackage('Helios-Debugger');
  2. smalltalk.addClass('HLContextInspectorDecorator', smalltalk.Object, ['context'], 'Helios-Debugger');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "context",
  6. fn: function (){
  7. var self=this;
  8. return smalltalk.withContext(function($ctx1) {
  9. var $1;
  10. $1=self["@context"];
  11. return $1;
  12. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.HLContextInspectorDecorator)})},
  13. messageSends: []}),
  14. smalltalk.HLContextInspectorDecorator);
  15. smalltalk.addMethod(
  16. smalltalk.method({
  17. selector: "initializeFromContext:",
  18. fn: function (aContext){
  19. var self=this;
  20. return smalltalk.withContext(function($ctx1) {
  21. self["@context"]=aContext;
  22. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromContext:",{aContext:aContext},smalltalk.HLContextInspectorDecorator)})},
  23. messageSends: []}),
  24. smalltalk.HLContextInspectorDecorator);
  25. smalltalk.addMethod(
  26. smalltalk.method({
  27. selector: "inspectOn:",
  28. fn: function (anInspector){
  29. var self=this;
  30. var variables,inspectedContext;
  31. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  32. return smalltalk.withContext(function($ctx1) {
  33. var $1,$2,$3;
  34. variables=_st($Dictionary())._new();
  35. inspectedContext=_st(self)._context();
  36. _st(variables)._addAll_(_st(inspectedContext)._locals());
  37. _st((function(){
  38. return smalltalk.withContext(function($ctx2) {
  39. return _st(_st(inspectedContext)._notNil())._and_((function(){
  40. return smalltalk.withContext(function($ctx3) {
  41. return _st(inspectedContext)._isBlockContext();
  42. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  43. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  44. return smalltalk.withContext(function($ctx2) {
  45. inspectedContext=_st(inspectedContext)._outerContext();
  46. inspectedContext;
  47. $1=inspectedContext;
  48. if(($receiver = $1) == nil || $receiver == undefined){
  49. return $1;
  50. } else {
  51. return _st(variables)._addAll_(_st(inspectedContext)._locals());
  52. };
  53. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  54. $2=anInspector;
  55. _st($2)._setLabel_("Context");
  56. $3=_st($2)._setVariables_(variables);
  57. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables,inspectedContext:inspectedContext},smalltalk.HLContextInspectorDecorator)})},
  58. messageSends: ["new", "context", "addAll:", "locals", "whileTrue:", "outerContext", "ifNotNil:", "and:", "isBlockContext", "notNil", "setLabel:", "setVariables:"]}),
  59. smalltalk.HLContextInspectorDecorator);
  60. smalltalk.addMethod(
  61. smalltalk.method({
  62. selector: "on:",
  63. fn: function (aContext){
  64. var self=this;
  65. return smalltalk.withContext(function($ctx1) {
  66. var $2,$3,$1;
  67. $2=_st(self)._new();
  68. _st($2)._initializeFromContext_(aContext);
  69. $3=_st($2)._yourself();
  70. $1=$3;
  71. return $1;
  72. }, function($ctx1) {$ctx1.fill(self,"on:",{aContext:aContext},smalltalk.HLContextInspectorDecorator.klass)})},
  73. messageSends: ["initializeFromContext:", "new", "yourself"]}),
  74. smalltalk.HLContextInspectorDecorator.klass);
  75. smalltalk.addClass('HLDebugger', smalltalk.HLFocusableWidget, ['model', 'stackListWidget', 'codeWidget', 'inspectorWidget'], 'Helios-Debugger');
  76. smalltalk.addMethod(
  77. smalltalk.method({
  78. selector: "codeWidget",
  79. fn: function (){
  80. var self=this;
  81. function $HLDebuggerCodeWidget(){return smalltalk.HLDebuggerCodeWidget||(typeof HLDebuggerCodeWidget=="undefined"?nil:HLDebuggerCodeWidget)}
  82. return smalltalk.withContext(function($ctx1) {
  83. var $2,$3,$4,$1;
  84. $2=self["@codeWidget"];
  85. if(($receiver = $2) == nil || $receiver == undefined){
  86. $3=_st($HLDebuggerCodeWidget())._new();
  87. _st($3)._browserModel_(_st(self)._model());
  88. $4=_st($3)._yourself();
  89. self["@codeWidget"]=$4;
  90. $1=self["@codeWidget"];
  91. } else {
  92. $1=$2;
  93. };
  94. return $1;
  95. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLDebugger)})},
  96. messageSends: ["ifNil:", "browserModel:", "model", "new", "yourself"]}),
  97. smalltalk.HLDebugger);
  98. smalltalk.addMethod(
  99. smalltalk.method({
  100. selector: "focus",
  101. fn: function (){
  102. var self=this;
  103. return smalltalk.withContext(function($ctx1) {
  104. _st(_st(self)._stackListWidget())._focus();
  105. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLDebugger)})},
  106. messageSends: ["focus", "stackListWidget"]}),
  107. smalltalk.HLDebugger);
  108. smalltalk.addMethod(
  109. smalltalk.method({
  110. selector: "initializeFromMethodContext:",
  111. fn: function (aMethodContext){
  112. var self=this;
  113. function $HLDebuggerModel(){return smalltalk.HLDebuggerModel||(typeof HLDebuggerModel=="undefined"?nil:HLDebuggerModel)}
  114. return smalltalk.withContext(function($ctx1) {
  115. self["@model"]=_st($HLDebuggerModel())._on_(aMethodContext);
  116. _st(self)._observeModel();
  117. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromMethodContext:",{aMethodContext:aMethodContext},smalltalk.HLDebugger)})},
  118. messageSends: ["on:", "observeModel"]}),
  119. smalltalk.HLDebugger);
  120. smalltalk.addMethod(
  121. smalltalk.method({
  122. selector: "inspectorWidget",
  123. fn: function (){
  124. var self=this;
  125. function $HLInspectorWidget(){return smalltalk.HLInspectorWidget||(typeof HLInspectorWidget=="undefined"?nil:HLInspectorWidget)}
  126. return smalltalk.withContext(function($ctx1) {
  127. var $2,$1;
  128. $2=self["@inspectorWidget"];
  129. if(($receiver = $2) == nil || $receiver == undefined){
  130. self["@inspectorWidget"]=_st($HLInspectorWidget())._new();
  131. $1=self["@inspectorWidget"];
  132. } else {
  133. $1=$2;
  134. };
  135. return $1;
  136. }, function($ctx1) {$ctx1.fill(self,"inspectorWidget",{},smalltalk.HLDebugger)})},
  137. messageSends: ["ifNil:", "new"]}),
  138. smalltalk.HLDebugger);
  139. smalltalk.addMethod(
  140. smalltalk.method({
  141. selector: "model",
  142. fn: function (){
  143. var self=this;
  144. function $HLDebuggerModel(){return smalltalk.HLDebuggerModel||(typeof HLDebuggerModel=="undefined"?nil:HLDebuggerModel)}
  145. return smalltalk.withContext(function($ctx1) {
  146. var $2,$1;
  147. $2=self["@model"];
  148. if(($receiver = $2) == nil || $receiver == undefined){
  149. self["@model"]=_st($HLDebuggerModel())._new();
  150. $1=self["@model"];
  151. } else {
  152. $1=$2;
  153. };
  154. return $1;
  155. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLDebugger)})},
  156. messageSends: ["ifNil:", "new"]}),
  157. smalltalk.HLDebugger);
  158. smalltalk.addMethod(
  159. smalltalk.method({
  160. selector: "observeModel",
  161. fn: function (){
  162. var self=this;
  163. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  164. return smalltalk.withContext(function($ctx1) {
  165. _st(_st(_st(self)._model())._announcer())._on_send_to_($HLDebuggerContextSelected(),"onContextSelected:",self);
  166. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLDebugger)})},
  167. messageSends: ["on:send:to:", "announcer", "model"]}),
  168. smalltalk.HLDebugger);
  169. smalltalk.addMethod(
  170. smalltalk.method({
  171. selector: "onContextSelected:",
  172. fn: function (anAnnouncement){
  173. var self=this;
  174. function $HLContextInspectorDecorator(){return smalltalk.HLContextInspectorDecorator||(typeof HLContextInspectorDecorator=="undefined"?nil:HLContextInspectorDecorator)}
  175. return smalltalk.withContext(function($ctx1) {
  176. _st(_st(self)._inspectorWidget())._inspect_(_st($HLContextInspectorDecorator())._on_(_st(anAnnouncement)._context()));
  177. return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLDebugger)})},
  178. messageSends: ["inspect:", "on:", "context", "inspectorWidget"]}),
  179. smalltalk.HLDebugger);
  180. smalltalk.addMethod(
  181. smalltalk.method({
  182. selector: "open",
  183. fn: function (){
  184. var self=this;
  185. function $HLTab(){return smalltalk.HLTab||(typeof HLTab=="undefined"?nil:HLTab)}
  186. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  187. return smalltalk.withContext(function($ctx1) {
  188. _st(_st($HLManager())._current())._addTab_(_st($HLTab())._on_labelled_(self,_st(_st(self)._class())._tabLabel()));
  189. return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.HLDebugger)})},
  190. messageSends: ["addTab:", "on:labelled:", "tabLabel", "class", "current"]}),
  191. smalltalk.HLDebugger);
  192. smalltalk.addMethod(
  193. smalltalk.method({
  194. selector: "renderContentOn:",
  195. fn: function (html){
  196. var self=this;
  197. function $HLVerticalSplitter(){return smalltalk.HLVerticalSplitter||(typeof HLVerticalSplitter=="undefined"?nil:HLVerticalSplitter)}
  198. function $HLHorizontalSplitter(){return smalltalk.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  199. function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  200. return smalltalk.withContext(function($ctx1) {
  201. _st(html)._with_(_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(_st(self)._stackListWidget(),_st($HLVerticalSplitter())._with_with_(_st(self)._codeWidget(),_st(self)._inspectorWidget()))));
  202. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLDebugger)})},
  203. messageSends: ["with:", "with:with:", "stackListWidget", "codeWidget", "inspectorWidget"]}),
  204. smalltalk.HLDebugger);
  205. smalltalk.addMethod(
  206. smalltalk.method({
  207. selector: "stackListWidget",
  208. fn: function (){
  209. var self=this;
  210. function $HLStackListWidget(){return smalltalk.HLStackListWidget||(typeof HLStackListWidget=="undefined"?nil:HLStackListWidget)}
  211. return smalltalk.withContext(function($ctx1) {
  212. var $2,$3,$4,$1;
  213. $2=self["@stackListWidget"];
  214. if(($receiver = $2) == nil || $receiver == undefined){
  215. $3=_st($HLStackListWidget())._on_(_st(self)._model());
  216. _st($3)._next_(_st(self)._codeWidget());
  217. $4=_st($3)._yourself();
  218. self["@stackListWidget"]=$4;
  219. $1=self["@stackListWidget"];
  220. } else {
  221. $1=$2;
  222. };
  223. return $1;
  224. }, function($ctx1) {$ctx1.fill(self,"stackListWidget",{},smalltalk.HLDebugger)})},
  225. messageSends: ["ifNil:", "next:", "codeWidget", "on:", "model", "yourself"]}),
  226. smalltalk.HLDebugger);
  227. smalltalk.addMethod(
  228. smalltalk.method({
  229. selector: "on:",
  230. fn: function (aMethodContext){
  231. var self=this;
  232. return smalltalk.withContext(function($ctx1) {
  233. var $2,$3,$1;
  234. $2=_st(self)._new();
  235. _st($2)._initializeFromMethodContext_(aMethodContext);
  236. $3=_st($2)._yourself();
  237. $1=$3;
  238. return $1;
  239. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},smalltalk.HLDebugger.klass)})},
  240. messageSends: ["initializeFromMethodContext:", "new", "yourself"]}),
  241. smalltalk.HLDebugger.klass);
  242. smalltalk.addMethod(
  243. smalltalk.method({
  244. selector: "tabClass",
  245. fn: function (){
  246. var self=this;
  247. return smalltalk.withContext(function($ctx1) {
  248. return "debugger";
  249. }, function($ctx1) {$ctx1.fill(self,"tabClass",{},smalltalk.HLDebugger.klass)})},
  250. messageSends: []}),
  251. smalltalk.HLDebugger.klass);
  252. smalltalk.addMethod(
  253. smalltalk.method({
  254. selector: "tabLabel",
  255. fn: function (){
  256. var self=this;
  257. return smalltalk.withContext(function($ctx1) {
  258. return "Debugger";
  259. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLDebugger.klass)})},
  260. messageSends: []}),
  261. smalltalk.HLDebugger.klass);
  262. smalltalk.addClass('HLDebuggerCodeWidget', smalltalk.HLBrowserCodeWidget, ['highlightedNode'], 'Helios-Debugger');
  263. smalltalk.addMethod(
  264. smalltalk.method({
  265. selector: "addStopAt:",
  266. fn: function (anInteger){
  267. var self=this;
  268. return smalltalk.withContext(function($ctx1) {
  269. _st(self["@editor"])._setGutterMarker_gutter_value_(anInteger,"stops",_st(_st(_st("<div class=\x22stop\x22></stop>")._asJQuery())._toArray())._first());
  270. return self}, function($ctx1) {$ctx1.fill(self,"addStopAt:",{anInteger:anInteger},smalltalk.HLDebuggerCodeWidget)})},
  271. messageSends: ["setGutterMarker:gutter:value:", "first", "toArray", "asJQuery"]}),
  272. smalltalk.HLDebuggerCodeWidget);
  273. smalltalk.addMethod(
  274. smalltalk.method({
  275. selector: "clearHighlight",
  276. fn: function (){
  277. var self=this;
  278. return smalltalk.withContext(function($ctx1) {
  279. var $1;
  280. _st(self["@editor"])._clearGutter_("stops");
  281. $1=_st(self)._highlightedNode();
  282. if(($receiver = $1) == nil || $receiver == undefined){
  283. $1;
  284. } else {
  285. var node;
  286. node=$receiver;
  287. _st(self["@editor"])._removeLineClass_where_class_(_st(_st(_st(node)._position())._x()).__minus((1)),"background","highlighted");
  288. };
  289. return self}, function($ctx1) {$ctx1.fill(self,"clearHighlight",{},smalltalk.HLDebuggerCodeWidget)})},
  290. messageSends: ["clearGutter:", "ifNotNil:", "removeLineClass:where:class:", "-", "x", "position", "highlightedNode"]}),
  291. smalltalk.HLDebuggerCodeWidget);
  292. smalltalk.addMethod(
  293. smalltalk.method({
  294. selector: "contents:",
  295. fn: function (aString){
  296. var self=this;
  297. return smalltalk.withContext(function($ctx1) {
  298. _st(self)._clearHighlight();
  299. smalltalk.HLBrowserCodeWidget.fn.prototype._contents_.apply(_st(self), [aString]);
  300. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLDebuggerCodeWidget)})},
  301. messageSends: ["clearHighlight", "contents:"]}),
  302. smalltalk.HLDebuggerCodeWidget);
  303. smalltalk.addMethod(
  304. smalltalk.method({
  305. selector: "editorOptions",
  306. fn: function (){
  307. var self=this;
  308. return smalltalk.withContext(function($ctx1) {
  309. var $2,$3,$1;
  310. $2=smalltalk.HLBrowserCodeWidget.fn.prototype._editorOptions.apply(_st(self), []);
  311. _st($2)._at_put_("gutters",["CodeMirror-linenumbers", "stops"]);
  312. $3=_st($2)._yourself();
  313. $1=$3;
  314. return $1;
  315. }, function($ctx1) {$ctx1.fill(self,"editorOptions",{},smalltalk.HLDebuggerCodeWidget)})},
  316. messageSends: ["at:put:", "editorOptions", "yourself"]}),
  317. smalltalk.HLDebuggerCodeWidget);
  318. smalltalk.addMethod(
  319. smalltalk.method({
  320. selector: "highlight",
  321. fn: function (){
  322. var self=this;
  323. var anchor,head,selection;
  324. return smalltalk.withContext(function($ctx1) {
  325. head=smalltalk.HashedCollection._fromPairs_([_st("line").__minus_gt(_st(_st(_st(_st(self)._highlightedNode())._position())._x()).__minus((1))),_st("ch").__minus_gt(_st(_st(_st(_st(self)._highlightedNode())._position())._y()).__minus((1)))]);
  326. anchor=smalltalk.HashedCollection._fromPairs_([_st("line").__minus_gt(_st(_st(_st(_st(self)._highlightedNode())._extent())._x()).__minus((1))),_st("ch").__minus_gt(_st(_st(_st(_st(self)._highlightedNode())._extent())._y()).__minus((1)))]);
  327. _st(self["@editor"])._setSelection_to_(head,anchor);
  328. return self}, function($ctx1) {$ctx1.fill(self,"highlight",{anchor:anchor,head:head,selection:selection},smalltalk.HLDebuggerCodeWidget)})},
  329. messageSends: ["->", "-", "x", "position", "highlightedNode", "y", "extent", "setSelection:to:"]}),
  330. smalltalk.HLDebuggerCodeWidget);
  331. smalltalk.addMethod(
  332. smalltalk.method({
  333. selector: "highlightLine:",
  334. fn: function (anInteger){
  335. var self=this;
  336. return smalltalk.withContext(function($ctx1) {
  337. _st(self["@editor"])._addLineClass_where_class_(anInteger,"background","highlighted");
  338. return self}, function($ctx1) {$ctx1.fill(self,"highlightLine:",{anInteger:anInteger},smalltalk.HLDebuggerCodeWidget)})},
  339. messageSends: ["addLineClass:where:class:"]}),
  340. smalltalk.HLDebuggerCodeWidget);
  341. smalltalk.addMethod(
  342. smalltalk.method({
  343. selector: "highlightNode:",
  344. fn: function (aNode){
  345. var self=this;
  346. var line;
  347. return smalltalk.withContext(function($ctx1) {
  348. var $1,$2,$3;
  349. $1=aNode;
  350. if(($receiver = $1) == nil || $receiver == undefined){
  351. $1;
  352. } else {
  353. line=_st(_st(_st(aNode)._position())._x()).__minus((1));
  354. line;
  355. $2=self;
  356. _st($2)._clearHighlight();
  357. _st($2)._addStopAt_(line);
  358. _st($2)._highlightLine_(line);
  359. $3=_st($2)._highlightedNode_(aNode);
  360. $3;
  361. };
  362. return self}, function($ctx1) {$ctx1.fill(self,"highlightNode:",{aNode:aNode,line:line},smalltalk.HLDebuggerCodeWidget)})},
  363. messageSends: ["ifNotNil:", "-", "x", "position", "clearHighlight", "addStopAt:", "highlightLine:", "highlightedNode:"]}),
  364. smalltalk.HLDebuggerCodeWidget);
  365. smalltalk.addMethod(
  366. smalltalk.method({
  367. selector: "highlightedNode",
  368. fn: function (){
  369. var self=this;
  370. return smalltalk.withContext(function($ctx1) {
  371. var $1;
  372. $1=self["@highlightedNode"];
  373. return $1;
  374. }, function($ctx1) {$ctx1.fill(self,"highlightedNode",{},smalltalk.HLDebuggerCodeWidget)})},
  375. messageSends: []}),
  376. smalltalk.HLDebuggerCodeWidget);
  377. smalltalk.addMethod(
  378. smalltalk.method({
  379. selector: "highlightedNode:",
  380. fn: function (aNode){
  381. var self=this;
  382. return smalltalk.withContext(function($ctx1) {
  383. self["@highlightedNode"]=aNode;
  384. return self}, function($ctx1) {$ctx1.fill(self,"highlightedNode:",{aNode:aNode},smalltalk.HLDebuggerCodeWidget)})},
  385. messageSends: []}),
  386. smalltalk.HLDebuggerCodeWidget);
  387. smalltalk.addMethod(
  388. smalltalk.method({
  389. selector: "observeBrowserModel",
  390. fn: function (){
  391. var self=this;
  392. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  393. return smalltalk.withContext(function($ctx1) {
  394. smalltalk.HLBrowserCodeWidget.fn.prototype._observeBrowserModel.apply(_st(self), []);
  395. _st(_st(_st(self)._browserModel())._announcer())._on_send_to_($HLDebuggerContextSelected(),"onContextSelected",self);
  396. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLDebuggerCodeWidget)})},
  397. messageSends: ["observeBrowserModel", "on:send:to:", "announcer", "browserModel"]}),
  398. smalltalk.HLDebuggerCodeWidget);
  399. smalltalk.addMethod(
  400. smalltalk.method({
  401. selector: "onContextSelected",
  402. fn: function (){
  403. var self=this;
  404. return smalltalk.withContext(function($ctx1) {
  405. _st(self)._highlightNode_(_st(_st(self)._browserModel())._nextNode());
  406. return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected",{},smalltalk.HLDebuggerCodeWidget)})},
  407. messageSends: ["highlightNode:", "nextNode", "browserModel"]}),
  408. smalltalk.HLDebuggerCodeWidget);
  409. smalltalk.addClass('HLDebuggerModel', smalltalk.HLToolModel, ['rootContext', 'currentContext', 'contexts', 'interpreter'], 'Helios-Debugger');
  410. smalltalk.addMethod(
  411. smalltalk.method({
  412. selector: "contexts",
  413. fn: function (){
  414. var self=this;
  415. return smalltalk.withContext(function($ctx1) {
  416. var $1;
  417. $1=self["@contexts"];
  418. return $1;
  419. }, function($ctx1) {$ctx1.fill(self,"contexts",{},smalltalk.HLDebuggerModel)})},
  420. messageSends: []}),
  421. smalltalk.HLDebuggerModel);
  422. smalltalk.addMethod(
  423. smalltalk.method({
  424. selector: "currentContext",
  425. fn: function (){
  426. var self=this;
  427. return smalltalk.withContext(function($ctx1) {
  428. var $1,$2;
  429. $1=self["@currentContext"];
  430. if(($receiver = $1) == nil || $receiver == undefined){
  431. _st(self)._currentContext_(_st(self)._rootContext());
  432. } else {
  433. $1;
  434. };
  435. $2=self["@currentContext"];
  436. return $2;
  437. }, function($ctx1) {$ctx1.fill(self,"currentContext",{},smalltalk.HLDebuggerModel)})},
  438. messageSends: ["ifNil:", "currentContext:", "rootContext"]}),
  439. smalltalk.HLDebuggerModel);
  440. smalltalk.addMethod(
  441. smalltalk.method({
  442. selector: "currentContext:",
  443. fn: function (aContext){
  444. var self=this;
  445. function $ASTDebugger(){return smalltalk.ASTDebugger||(typeof ASTDebugger=="undefined"?nil:ASTDebugger)}
  446. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  447. return smalltalk.withContext(function($ctx1) {
  448. var $1,$2;
  449. _st(self)._withChangesDo_((function(){
  450. return smalltalk.withContext(function($ctx2) {
  451. _st(self)._selectedMethod_(_st(aContext)._method());
  452. self["@currentContext"]=aContext;
  453. self["@currentContext"];
  454. self["@interpreter"]=_st($ASTDebugger())._context_(aContext);
  455. self["@interpreter"];
  456. $1=_st($HLDebuggerContextSelected())._new();
  457. _st($1)._context_(aContext);
  458. $2=_st($1)._yourself();
  459. return _st(_st(self)._announcer())._announce_($2);
  460. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  461. return self}, function($ctx1) {$ctx1.fill(self,"currentContext:",{aContext:aContext},smalltalk.HLDebuggerModel)})},
  462. messageSends: ["withChangesDo:", "selectedMethod:", "method", "context:", "announce:", "new", "yourself", "announcer"]}),
  463. smalltalk.HLDebuggerModel);
  464. smalltalk.addMethod(
  465. smalltalk.method({
  466. selector: "initializeContexts",
  467. fn: function (){
  468. var self=this;
  469. var context;
  470. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  471. return smalltalk.withContext(function($ctx1) {
  472. self["@contexts"]=_st($OrderedCollection())._new();
  473. context=_st(self)._rootContext();
  474. _st((function(){
  475. return smalltalk.withContext(function($ctx2) {
  476. return _st(context)._notNil();
  477. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  478. return smalltalk.withContext(function($ctx2) {
  479. _st(self["@contexts"])._add_(context);
  480. context=_st(context)._outerContext();
  481. return context;
  482. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  483. return self}, function($ctx1) {$ctx1.fill(self,"initializeContexts",{context:context},smalltalk.HLDebuggerModel)})},
  484. messageSends: ["new", "rootContext", "whileTrue:", "add:", "outerContext", "notNil"]}),
  485. smalltalk.HLDebuggerModel);
  486. smalltalk.addMethod(
  487. smalltalk.method({
  488. selector: "initializeFromContext:",
  489. fn: function (aMethodContext){
  490. var self=this;
  491. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  492. return smalltalk.withContext(function($ctx1) {
  493. self["@rootContext"]=_st($AIContext())._fromMethodContext_(aMethodContext);
  494. _st(self)._initializeContexts();
  495. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromContext:",{aMethodContext:aMethodContext},smalltalk.HLDebuggerModel)})},
  496. messageSends: ["fromMethodContext:", "initializeContexts"]}),
  497. smalltalk.HLDebuggerModel);
  498. smalltalk.addMethod(
  499. smalltalk.method({
  500. selector: "interpreter",
  501. fn: function (){
  502. var self=this;
  503. return smalltalk.withContext(function($ctx1) {
  504. var $1;
  505. $1=self["@interpreter"];
  506. return $1;
  507. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.HLDebuggerModel)})},
  508. messageSends: []}),
  509. smalltalk.HLDebuggerModel);
  510. smalltalk.addMethod(
  511. smalltalk.method({
  512. selector: "nextNode",
  513. fn: function (){
  514. var self=this;
  515. return smalltalk.withContext(function($ctx1) {
  516. var $1;
  517. $1=_st(_st(self)._interpreter())._nextNode();
  518. return $1;
  519. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.HLDebuggerModel)})},
  520. messageSends: ["nextNode", "interpreter"]}),
  521. smalltalk.HLDebuggerModel);
  522. smalltalk.addMethod(
  523. smalltalk.method({
  524. selector: "rootContext",
  525. fn: function (){
  526. var self=this;
  527. return smalltalk.withContext(function($ctx1) {
  528. var $1;
  529. $1=self["@rootContext"];
  530. return $1;
  531. }, function($ctx1) {$ctx1.fill(self,"rootContext",{},smalltalk.HLDebuggerModel)})},
  532. messageSends: []}),
  533. smalltalk.HLDebuggerModel);
  534. smalltalk.addMethod(
  535. smalltalk.method({
  536. selector: "on:",
  537. fn: function (aMethodContext){
  538. var self=this;
  539. return smalltalk.withContext(function($ctx1) {
  540. var $2,$3,$1;
  541. $2=_st(self)._new();
  542. _st($2)._initializeFromContext_(aMethodContext);
  543. $3=_st($2)._yourself();
  544. $1=$3;
  545. return $1;
  546. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},smalltalk.HLDebuggerModel.klass)})},
  547. messageSends: ["initializeFromContext:", "new", "yourself"]}),
  548. smalltalk.HLDebuggerModel.klass);
  549. smalltalk.addClass('HLErrorHandler', smalltalk.ErrorHandler, [], 'Helios-Debugger');
  550. smalltalk.addMethod(
  551. smalltalk.method({
  552. selector: "handleError:",
  553. fn: function (anError){
  554. var self=this;
  555. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  556. function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  557. function $HLDebugger(){return smalltalk.HLDebugger||(typeof HLDebugger=="undefined"?nil:HLDebugger)}
  558. return smalltalk.withContext(function($ctx1) {
  559. _st((function(){
  560. return smalltalk.withContext(function($ctx2) {
  561. return _st(_st($HLDebugger())._on_(_st(anError)._context()))._open();
  562. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(error){
  563. return smalltalk.withContext(function($ctx2) {
  564. return _st(_st($ErrorHandler())._new())._handleError_(error);
  565. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1)})}));
  566. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.HLErrorHandler)})},
  567. messageSends: ["on:do:", "handleError:", "new", "open", "on:", "context"]}),
  568. smalltalk.HLErrorHandler);
  569. smalltalk.addClass('HLStackListWidget', smalltalk.HLToolListWidget, [], 'Helios-Debugger');
  570. smalltalk.addMethod(
  571. smalltalk.method({
  572. selector: "items",
  573. fn: function (){
  574. var self=this;
  575. return smalltalk.withContext(function($ctx1) {
  576. var $2,$1;
  577. $2=self["@items"];
  578. if(($receiver = $2) == nil || $receiver == undefined){
  579. self["@items"]=_st(_st(self)._model())._contexts();
  580. $1=self["@items"];
  581. } else {
  582. $1=$2;
  583. };
  584. return $1;
  585. }, function($ctx1) {$ctx1.fill(self,"items",{},smalltalk.HLStackListWidget)})},
  586. messageSends: ["ifNil:", "contexts", "model"]}),
  587. smalltalk.HLStackListWidget);
  588. smalltalk.addMethod(
  589. smalltalk.method({
  590. selector: "label",
  591. fn: function (){
  592. var self=this;
  593. return smalltalk.withContext(function($ctx1) {
  594. return "Call stack";
  595. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLStackListWidget)})},
  596. messageSends: []}),
  597. smalltalk.HLStackListWidget);
  598. smalltalk.addMethod(
  599. smalltalk.method({
  600. selector: "selectItem:",
  601. fn: function (aContext){
  602. var self=this;
  603. return smalltalk.withContext(function($ctx1) {
  604. _st(_st(self)._model())._currentContext_(aContext);
  605. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{aContext:aContext},smalltalk.HLStackListWidget)})},
  606. messageSends: ["currentContext:", "model"]}),
  607. smalltalk.HLStackListWidget);