Helios-Debugger.deploy.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  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=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({},$ctx2,2)})}));
  43. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._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,3)})}));
  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:", "and:", "notNil", "isBlockContext", "outerContext", "ifNotNil:", "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=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_(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:", "new", "model", "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(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. 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. function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  165. return smalltalk.withContext(function($ctx1) {
  166. _st(_st(self._model())._announcer())._on_send_to_($HLDebuggerContextSelected(),"onContextSelected:",self);
  167. _st(_st(self._model())._announcer())._on_send_to_($HLDebuggerStepped(),"onContextSelected:",self);
  168. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLDebugger)})},
  169. messageSends: ["on:send:to:", "announcer", "model"]}),
  170. smalltalk.HLDebugger);
  171. smalltalk.addMethod(
  172. smalltalk.method({
  173. selector: "onContextSelected:",
  174. fn: function (anAnnouncement){
  175. var self=this;
  176. function $HLContextInspectorDecorator(){return smalltalk.HLContextInspectorDecorator||(typeof HLContextInspectorDecorator=="undefined"?nil:HLContextInspectorDecorator)}
  177. return smalltalk.withContext(function($ctx1) {
  178. _st(self._inspectorWidget())._inspect_(_st($HLContextInspectorDecorator())._on_(_st(anAnnouncement)._context()));
  179. return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLDebugger)})},
  180. messageSends: ["inspect:", "inspectorWidget", "on:", "context"]}),
  181. smalltalk.HLDebugger);
  182. smalltalk.addMethod(
  183. smalltalk.method({
  184. selector: "registerBindingsOn:",
  185. fn: function (aBindingGroup){
  186. var self=this;
  187. function $HLToolCommand(){return smalltalk.HLToolCommand||(typeof HLToolCommand=="undefined"?nil:HLToolCommand)}
  188. return smalltalk.withContext(function($ctx1) {
  189. _st($HLToolCommand())._registerConcreteClassesOn_for_(aBindingGroup,self._model());
  190. return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup},smalltalk.HLDebugger)})},
  191. messageSends: ["registerConcreteClassesOn:for:", "model"]}),
  192. smalltalk.HLDebugger);
  193. smalltalk.addMethod(
  194. smalltalk.method({
  195. selector: "renderContentOn:",
  196. fn: function (html){
  197. var self=this;
  198. function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  199. function $HLHorizontalSplitter(){return smalltalk.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  200. function $HLVerticalSplitter(){return smalltalk.HLVerticalSplitter||(typeof HLVerticalSplitter=="undefined"?nil:HLVerticalSplitter)}
  201. return smalltalk.withContext(function($ctx1) {
  202. _st(html)._with_(_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(self._stackListWidget(),_st($HLVerticalSplitter())._with_with_(self._codeWidget(),self._inspectorWidget()))));
  203. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLDebugger)})},
  204. messageSends: ["with:", "with:with:", "stackListWidget", "codeWidget", "inspectorWidget"]}),
  205. smalltalk.HLDebugger);
  206. smalltalk.addMethod(
  207. smalltalk.method({
  208. selector: "stackListWidget",
  209. fn: function (){
  210. var self=this;
  211. function $HLStackListWidget(){return smalltalk.HLStackListWidget||(typeof HLStackListWidget=="undefined"?nil:HLStackListWidget)}
  212. return smalltalk.withContext(function($ctx1) {
  213. var $2,$3,$4,$1;
  214. $2=self["@stackListWidget"];
  215. if(($receiver = $2) == nil || $receiver == undefined){
  216. $3=_st($HLStackListWidget())._on_(self._model());
  217. _st($3)._next_(self._codeWidget());
  218. $4=_st($3)._yourself();
  219. self["@stackListWidget"]=$4;
  220. $1=self["@stackListWidget"];
  221. } else {
  222. $1=$2;
  223. };
  224. return $1;
  225. }, function($ctx1) {$ctx1.fill(self,"stackListWidget",{},smalltalk.HLDebugger)})},
  226. messageSends: ["ifNil:", "next:", "on:", "model", "codeWidget", "yourself"]}),
  227. smalltalk.HLDebugger);
  228. smalltalk.addMethod(
  229. smalltalk.method({
  230. selector: "unregister",
  231. fn: function (){
  232. var self=this;
  233. return smalltalk.withContext(function($ctx1) {
  234. smalltalk.HLDebugger.superclass.fn.prototype._unregister.apply(_st(self), []);
  235. _st(self._inspectorWidget())._unregister();
  236. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLDebugger)})},
  237. messageSends: ["unregister", "inspectorWidget"]}),
  238. smalltalk.HLDebugger);
  239. smalltalk.addMethod(
  240. smalltalk.method({
  241. selector: "on:",
  242. fn: function (aMethodContext){
  243. var self=this;
  244. return smalltalk.withContext(function($ctx1) {
  245. var $2,$3,$1;
  246. $2=self._new();
  247. _st($2)._initializeFromMethodContext_(aMethodContext);
  248. $3=_st($2)._yourself();
  249. $1=$3;
  250. return $1;
  251. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},smalltalk.HLDebugger.klass)})},
  252. messageSends: ["initializeFromMethodContext:", "new", "yourself"]}),
  253. smalltalk.HLDebugger.klass);
  254. smalltalk.addMethod(
  255. smalltalk.method({
  256. selector: "tabClass",
  257. fn: function (){
  258. var self=this;
  259. return smalltalk.withContext(function($ctx1) {
  260. return "debugger";
  261. }, function($ctx1) {$ctx1.fill(self,"tabClass",{},smalltalk.HLDebugger.klass)})},
  262. messageSends: []}),
  263. smalltalk.HLDebugger.klass);
  264. smalltalk.addMethod(
  265. smalltalk.method({
  266. selector: "tabLabel",
  267. fn: function (){
  268. var self=this;
  269. return smalltalk.withContext(function($ctx1) {
  270. return "Debugger";
  271. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLDebugger.klass)})},
  272. messageSends: []}),
  273. smalltalk.HLDebugger.klass);
  274. smalltalk.addClass('HLDebuggerCodeWidget', smalltalk.HLBrowserCodeWidget, [], 'Helios-Debugger');
  275. smalltalk.addMethod(
  276. smalltalk.method({
  277. selector: "addStopAt:",
  278. fn: function (anInteger){
  279. var self=this;
  280. return smalltalk.withContext(function($ctx1) {
  281. _st(self["@editor"])._setGutterMarker_gutter_value_(anInteger,"stops",_st(_st("<div class=\x22stop\x22></stop>"._asJQuery())._toArray())._first());
  282. return self}, function($ctx1) {$ctx1.fill(self,"addStopAt:",{anInteger:anInteger},smalltalk.HLDebuggerCodeWidget)})},
  283. messageSends: ["setGutterMarker:gutter:value:", "first", "toArray", "asJQuery"]}),
  284. smalltalk.HLDebuggerCodeWidget);
  285. smalltalk.addMethod(
  286. smalltalk.method({
  287. selector: "clearHighlight",
  288. fn: function (){
  289. var self=this;
  290. return smalltalk.withContext(function($ctx1) {
  291. _st(self._editor())._clearGutter_("stops");
  292. return self}, function($ctx1) {$ctx1.fill(self,"clearHighlight",{},smalltalk.HLDebuggerCodeWidget)})},
  293. messageSends: ["clearGutter:", "editor"]}),
  294. smalltalk.HLDebuggerCodeWidget);
  295. smalltalk.addMethod(
  296. smalltalk.method({
  297. selector: "contents:",
  298. fn: function (aString){
  299. var self=this;
  300. return smalltalk.withContext(function($ctx1) {
  301. self._clearHighlight();
  302. smalltalk.HLDebuggerCodeWidget.superclass.fn.prototype._contents_.apply(_st(self), [aString]);
  303. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLDebuggerCodeWidget)})},
  304. messageSends: ["clearHighlight", "contents:"]}),
  305. smalltalk.HLDebuggerCodeWidget);
  306. smalltalk.addMethod(
  307. smalltalk.method({
  308. selector: "editorOptions",
  309. fn: function (){
  310. var self=this;
  311. return smalltalk.withContext(function($ctx1) {
  312. var $2,$3,$1;
  313. $2=smalltalk.HLDebuggerCodeWidget.superclass.fn.prototype._editorOptions.apply(_st(self), []);
  314. _st($2)._at_put_("gutters",["CodeMirror-linenumbers", "stops"]);
  315. $3=_st($2)._yourself();
  316. $1=$3;
  317. return $1;
  318. }, function($ctx1) {$ctx1.fill(self,"editorOptions",{},smalltalk.HLDebuggerCodeWidget)})},
  319. messageSends: ["at:put:", "editorOptions", "yourself"]}),
  320. smalltalk.HLDebuggerCodeWidget);
  321. smalltalk.addMethod(
  322. smalltalk.method({
  323. selector: "highlight",
  324. fn: function (){
  325. var self=this;
  326. return smalltalk.withContext(function($ctx1) {
  327. self._highlightNode_(_st(self._browserModel())._nextNode());
  328. return self}, function($ctx1) {$ctx1.fill(self,"highlight",{},smalltalk.HLDebuggerCodeWidget)})},
  329. messageSends: ["highlightNode:", "nextNode", "browserModel"]}),
  330. smalltalk.HLDebuggerCodeWidget);
  331. smalltalk.addMethod(
  332. smalltalk.method({
  333. selector: "highlightNode:",
  334. fn: function (aNode){
  335. var self=this;
  336. var token;
  337. return smalltalk.withContext(function($ctx1) {
  338. var $1,$2,$3;
  339. $1=aNode;
  340. if(($receiver = $1) == nil || $receiver == undefined){
  341. $1;
  342. } else {
  343. token=_st(self._editor())._getTokenAt_(smalltalk.HashedCollection._from_(["line".__minus_gt(_st(_st(_st(aNode)._position())._x()).__minus((1))),"ch".__minus_gt(_st(_st(aNode)._position())._y())]));
  344. token;
  345. $2=self;
  346. _st($2)._clearHighlight();
  347. $3=_st($2)._addStopAt_(_st(_st(_st(aNode)._position())._x()).__minus((1)));
  348. $3;
  349. _st(self._editor())._setSelection_to_(smalltalk.HashedCollection._from_(["line".__minus_gt(_st(_st(_st(aNode)._position())._x()).__minus((1))),"ch".__minus_gt(_st(token)._start())]),smalltalk.HashedCollection._from_(["line".__minus_gt(_st(_st(_st(aNode)._position())._x()).__minus((1))),"ch".__minus_gt(_st(token)._end())]));
  350. };
  351. return self}, function($ctx1) {$ctx1.fill(self,"highlightNode:",{aNode:aNode,token:token},smalltalk.HLDebuggerCodeWidget)})},
  352. messageSends: ["ifNotNil:", "getTokenAt:", "editor", "->", "-", "x", "position", "y", "clearHighlight", "addStopAt:", "setSelection:to:", "start", "end"]}),
  353. smalltalk.HLDebuggerCodeWidget);
  354. smalltalk.addMethod(
  355. smalltalk.method({
  356. selector: "observeBrowserModel",
  357. fn: function (){
  358. var self=this;
  359. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  360. function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  361. function $HLDebuggerWhere(){return smalltalk.HLDebuggerWhere||(typeof HLDebuggerWhere=="undefined"?nil:HLDebuggerWhere)}
  362. return smalltalk.withContext(function($ctx1) {
  363. smalltalk.HLDebuggerCodeWidget.superclass.fn.prototype._observeBrowserModel.apply(_st(self), []);
  364. _st(_st(self._browserModel())._announcer())._on_send_to_($HLDebuggerContextSelected(),"onContextSelected",self);
  365. _st(_st(self._browserModel())._announcer())._on_send_to_($HLDebuggerStepped(),"onContextSelected",self);
  366. _st(_st(self._browserModel())._announcer())._on_send_to_($HLDebuggerWhere(),"onContextSelected",self);
  367. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLDebuggerCodeWidget)})},
  368. messageSends: ["observeBrowserModel", "on:send:to:", "announcer", "browserModel"]}),
  369. smalltalk.HLDebuggerCodeWidget);
  370. smalltalk.addMethod(
  371. smalltalk.method({
  372. selector: "onContextSelected",
  373. fn: function (){
  374. var self=this;
  375. return smalltalk.withContext(function($ctx1) {
  376. self._highlight();
  377. return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected",{},smalltalk.HLDebuggerCodeWidget)})},
  378. messageSends: ["highlight"]}),
  379. smalltalk.HLDebuggerCodeWidget);
  380. smalltalk.addClass('HLDebuggerModel', smalltalk.HLToolModel, ['rootContext', 'currentContext', 'contexts'], 'Helios-Debugger');
  381. smalltalk.addMethod(
  382. smalltalk.method({
  383. selector: "contexts",
  384. fn: function (){
  385. var self=this;
  386. return smalltalk.withContext(function($ctx1) {
  387. var $1;
  388. $1=self["@contexts"];
  389. return $1;
  390. }, function($ctx1) {$ctx1.fill(self,"contexts",{},smalltalk.HLDebuggerModel)})},
  391. messageSends: []}),
  392. smalltalk.HLDebuggerModel);
  393. smalltalk.addMethod(
  394. smalltalk.method({
  395. selector: "currentContext",
  396. fn: function (){
  397. var self=this;
  398. return smalltalk.withContext(function($ctx1) {
  399. var $1,$2;
  400. $1=self["@currentContext"];
  401. if(($receiver = $1) == nil || $receiver == undefined){
  402. self._currentContext_(self._rootContext());
  403. } else {
  404. $1;
  405. };
  406. $2=self["@currentContext"];
  407. return $2;
  408. }, function($ctx1) {$ctx1.fill(self,"currentContext",{},smalltalk.HLDebuggerModel)})},
  409. messageSends: ["ifNil:", "currentContext:", "rootContext"]}),
  410. smalltalk.HLDebuggerModel);
  411. smalltalk.addMethod(
  412. smalltalk.method({
  413. selector: "currentContext:",
  414. fn: function (aContext){
  415. var self=this;
  416. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  417. return smalltalk.withContext(function($ctx1) {
  418. var $1,$2;
  419. self._withChangesDo_((function(){
  420. return smalltalk.withContext(function($ctx2) {
  421. self._selectedMethod_(_st(aContext)._method());
  422. self["@currentContext"]=aContext;
  423. self["@currentContext"];
  424. $1=_st($HLDebuggerContextSelected())._new();
  425. _st($1)._context_(aContext);
  426. $2=_st($1)._yourself();
  427. return _st(self._announcer())._announce_($2);
  428. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  429. return self}, function($ctx1) {$ctx1.fill(self,"currentContext:",{aContext:aContext},smalltalk.HLDebuggerModel)})},
  430. messageSends: ["withChangesDo:", "selectedMethod:", "method", "announce:", "announcer", "context:", "new", "yourself"]}),
  431. smalltalk.HLDebuggerModel);
  432. smalltalk.addMethod(
  433. smalltalk.method({
  434. selector: "initializeContexts",
  435. fn: function (){
  436. var self=this;
  437. var context;
  438. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  439. return smalltalk.withContext(function($ctx1) {
  440. self["@contexts"]=_st($OrderedCollection())._new();
  441. context=self._rootContext();
  442. _st((function(){
  443. return smalltalk.withContext(function($ctx2) {
  444. return _st(context)._notNil();
  445. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileTrue_((function(){
  446. return smalltalk.withContext(function($ctx2) {
  447. _st(self["@contexts"])._add_(context);
  448. context=_st(context)._outerContext();
  449. return context;
  450. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  451. return self}, function($ctx1) {$ctx1.fill(self,"initializeContexts",{context:context},smalltalk.HLDebuggerModel)})},
  452. messageSends: ["new", "rootContext", "whileTrue:", "notNil", "add:", "outerContext"]}),
  453. smalltalk.HLDebuggerModel);
  454. smalltalk.addMethod(
  455. smalltalk.method({
  456. selector: "initializeFromContext:",
  457. fn: function (aMethodContext){
  458. var self=this;
  459. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  460. return smalltalk.withContext(function($ctx1) {
  461. self["@rootContext"]=_st($AIContext())._fromMethodContext_(aMethodContext);
  462. self._initializeContexts();
  463. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromContext:",{aMethodContext:aMethodContext},smalltalk.HLDebuggerModel)})},
  464. messageSends: ["fromMethodContext:", "initializeContexts"]}),
  465. smalltalk.HLDebuggerModel);
  466. smalltalk.addMethod(
  467. smalltalk.method({
  468. selector: "interpreter",
  469. fn: function (){
  470. var self=this;
  471. return smalltalk.withContext(function($ctx1) {
  472. var $1;
  473. $1=_st(self._currentContext())._interpreter();
  474. return $1;
  475. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.HLDebuggerModel)})},
  476. messageSends: ["interpreter", "currentContext"]}),
  477. smalltalk.HLDebuggerModel);
  478. smalltalk.addMethod(
  479. smalltalk.method({
  480. selector: "nextNode",
  481. fn: function (){
  482. var self=this;
  483. return smalltalk.withContext(function($ctx1) {
  484. var $1;
  485. $1=_st(self._interpreter())._node();
  486. return $1;
  487. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.HLDebuggerModel)})},
  488. messageSends: ["node", "interpreter"]}),
  489. smalltalk.HLDebuggerModel);
  490. smalltalk.addMethod(
  491. smalltalk.method({
  492. selector: "restart",
  493. fn: function (){
  494. var self=this;
  495. function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  496. return smalltalk.withContext(function($ctx1) {
  497. var $1,$2;
  498. _st(self._interpreter())._restart();
  499. $1=_st($HLDebuggerStepped())._new();
  500. _st($1)._context_(self._currentContext());
  501. $2=_st($1)._yourself();
  502. _st(self._announcer())._announce_($2);
  503. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.HLDebuggerModel)})},
  504. messageSends: ["restart", "interpreter", "announce:", "announcer", "context:", "new", "currentContext", "yourself"]}),
  505. smalltalk.HLDebuggerModel);
  506. smalltalk.addMethod(
  507. smalltalk.method({
  508. selector: "rootContext",
  509. fn: function (){
  510. var self=this;
  511. return smalltalk.withContext(function($ctx1) {
  512. var $1;
  513. $1=self["@rootContext"];
  514. return $1;
  515. }, function($ctx1) {$ctx1.fill(self,"rootContext",{},smalltalk.HLDebuggerModel)})},
  516. messageSends: []}),
  517. smalltalk.HLDebuggerModel);
  518. smalltalk.addMethod(
  519. smalltalk.method({
  520. selector: "stepOver",
  521. fn: function (){
  522. var self=this;
  523. function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  524. return smalltalk.withContext(function($ctx1) {
  525. var $1,$2;
  526. _st(self._interpreter())._stepOver();
  527. $1=_st($HLDebuggerStepped())._new();
  528. _st($1)._context_(self._currentContext());
  529. $2=_st($1)._yourself();
  530. _st(self._announcer())._announce_($2);
  531. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.HLDebuggerModel)})},
  532. messageSends: ["stepOver", "interpreter", "announce:", "announcer", "context:", "new", "currentContext", "yourself"]}),
  533. smalltalk.HLDebuggerModel);
  534. smalltalk.addMethod(
  535. smalltalk.method({
  536. selector: "where",
  537. fn: function (){
  538. var self=this;
  539. function $HLDebuggerWhere(){return smalltalk.HLDebuggerWhere||(typeof HLDebuggerWhere=="undefined"?nil:HLDebuggerWhere)}
  540. return smalltalk.withContext(function($ctx1) {
  541. _st(self._announcer())._announce_(_st($HLDebuggerWhere())._new());
  542. return self}, function($ctx1) {$ctx1.fill(self,"where",{},smalltalk.HLDebuggerModel)})},
  543. messageSends: ["announce:", "announcer", "new"]}),
  544. smalltalk.HLDebuggerModel);
  545. smalltalk.addMethod(
  546. smalltalk.method({
  547. selector: "on:",
  548. fn: function (aMethodContext){
  549. var self=this;
  550. return smalltalk.withContext(function($ctx1) {
  551. var $2,$3,$1;
  552. $2=self._new();
  553. _st($2)._initializeFromContext_(aMethodContext);
  554. $3=_st($2)._yourself();
  555. $1=$3;
  556. return $1;
  557. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},smalltalk.HLDebuggerModel.klass)})},
  558. messageSends: ["initializeFromContext:", "new", "yourself"]}),
  559. smalltalk.HLDebuggerModel.klass);
  560. smalltalk.addClass('HLErrorHandler', smalltalk.ErrorHandler, [], 'Helios-Debugger');
  561. smalltalk.addMethod(
  562. smalltalk.method({
  563. selector: "handleError:",
  564. fn: function (anError){
  565. var self=this;
  566. function $HLDebugger(){return smalltalk.HLDebugger||(typeof HLDebugger=="undefined"?nil:HLDebugger)}
  567. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  568. function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  569. return smalltalk.withContext(function($ctx1) {
  570. self._onErrorHandled();
  571. _st((function(){
  572. return smalltalk.withContext(function($ctx2) {
  573. return _st(_st($HLDebugger())._on_(_st(anError)._context()))._openAsTab();
  574. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($Error(),(function(error){
  575. return smalltalk.withContext(function($ctx2) {
  576. return _st(_st($ErrorHandler())._new())._handleError_(error);
  577. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1,2)})}));
  578. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.HLErrorHandler)})},
  579. messageSends: ["onErrorHandled", "on:do:", "openAsTab", "on:", "context", "handleError:", "new"]}),
  580. smalltalk.HLErrorHandler);
  581. smalltalk.addMethod(
  582. smalltalk.method({
  583. selector: "onErrorHandled",
  584. fn: function (){
  585. var self=this;
  586. function $HLProgressWidget(){return smalltalk.HLProgressWidget||(typeof HLProgressWidget=="undefined"?nil:HLProgressWidget)}
  587. return smalltalk.withContext(function($ctx1) {
  588. var $1,$2;
  589. $1=_st($HLProgressWidget())._default();
  590. _st($1)._flush();
  591. $2=_st($1)._remove();
  592. return self}, function($ctx1) {$ctx1.fill(self,"onErrorHandled",{},smalltalk.HLErrorHandler)})},
  593. messageSends: ["flush", "default", "remove"]}),
  594. smalltalk.HLErrorHandler);
  595. smalltalk.addMethod(
  596. smalltalk.method({
  597. selector: "handleError:",
  598. fn: function (anError){
  599. var self=this;
  600. return smalltalk.withContext(function($ctx1) {
  601. var $1;
  602. $1=_st(self._new())._handleError_(anError);
  603. return $1;
  604. }, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.HLErrorHandler.klass)})},
  605. messageSends: ["handleError:", "new"]}),
  606. smalltalk.HLErrorHandler.klass);
  607. smalltalk.addClass('HLStackListWidget', smalltalk.HLToolListWidget, [], 'Helios-Debugger');
  608. smalltalk.addMethod(
  609. smalltalk.method({
  610. selector: "items",
  611. fn: function (){
  612. var self=this;
  613. return smalltalk.withContext(function($ctx1) {
  614. var $2,$1;
  615. $2=self["@items"];
  616. if(($receiver = $2) == nil || $receiver == undefined){
  617. self["@items"]=_st(self._model())._contexts();
  618. $1=self["@items"];
  619. } else {
  620. $1=$2;
  621. };
  622. return $1;
  623. }, function($ctx1) {$ctx1.fill(self,"items",{},smalltalk.HLStackListWidget)})},
  624. messageSends: ["ifNil:", "contexts", "model"]}),
  625. smalltalk.HLStackListWidget);
  626. smalltalk.addMethod(
  627. smalltalk.method({
  628. selector: "label",
  629. fn: function (){
  630. var self=this;
  631. return smalltalk.withContext(function($ctx1) {
  632. return "Call stack";
  633. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLStackListWidget)})},
  634. messageSends: []}),
  635. smalltalk.HLStackListWidget);
  636. smalltalk.addMethod(
  637. smalltalk.method({
  638. selector: "renderButtonsOn:",
  639. fn: function (html){
  640. var self=this;
  641. return smalltalk.withContext(function($ctx1) {
  642. var $1,$3,$4,$5,$6,$7,$8,$2;
  643. $1=_st(html)._div();
  644. _st($1)._class_("debugger_bar");
  645. $2=_st($1)._with_((function(){
  646. return smalltalk.withContext(function($ctx2) {
  647. $3=_st(html)._button();
  648. _st($3)._class_("btn restart");
  649. _st($3)._with_("Restart");
  650. $4=_st($3)._onClick_((function(){
  651. return smalltalk.withContext(function($ctx3) {
  652. return self._restart();
  653. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  654. $4;
  655. $5=_st(html)._button();
  656. _st($5)._class_("btn where");
  657. _st($5)._with_("Where");
  658. $6=_st($5)._onClick_((function(){
  659. return smalltalk.withContext(function($ctx3) {
  660. return self._where();
  661. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  662. $6;
  663. $7=_st(html)._button();
  664. _st($7)._class_("btn stepOver");
  665. _st($7)._with_("Step over");
  666. $8=_st($7)._onClick_((function(){
  667. return smalltalk.withContext(function($ctx3) {
  668. return self._stepOver();
  669. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
  670. return $8;
  671. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  672. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLStackListWidget)})},
  673. messageSends: ["class:", "div", "with:", "button", "onClick:", "restart", "where", "stepOver"]}),
  674. smalltalk.HLStackListWidget);
  675. smalltalk.addMethod(
  676. smalltalk.method({
  677. selector: "restart",
  678. fn: function (){
  679. var self=this;
  680. return smalltalk.withContext(function($ctx1) {
  681. _st(self._model())._restart();
  682. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.HLStackListWidget)})},
  683. messageSends: ["restart", "model"]}),
  684. smalltalk.HLStackListWidget);
  685. smalltalk.addMethod(
  686. smalltalk.method({
  687. selector: "selectItem:",
  688. fn: function (aContext){
  689. var self=this;
  690. return smalltalk.withContext(function($ctx1) {
  691. _st(self._model())._currentContext_(aContext);
  692. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{aContext:aContext},smalltalk.HLStackListWidget)})},
  693. messageSends: ["currentContext:", "model"]}),
  694. smalltalk.HLStackListWidget);
  695. smalltalk.addMethod(
  696. smalltalk.method({
  697. selector: "stepOver",
  698. fn: function (){
  699. var self=this;
  700. return smalltalk.withContext(function($ctx1) {
  701. _st(self._model())._stepOver();
  702. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.HLStackListWidget)})},
  703. messageSends: ["stepOver", "model"]}),
  704. smalltalk.HLStackListWidget);
  705. smalltalk.addMethod(
  706. smalltalk.method({
  707. selector: "where",
  708. fn: function (){
  709. var self=this;
  710. return smalltalk.withContext(function($ctx1) {
  711. _st(self._model())._where();
  712. return self}, function($ctx1) {$ctx1.fill(self,"where",{},smalltalk.HLStackListWidget)})},
  713. messageSends: ["where", "model"]}),
  714. smalltalk.HLStackListWidget);