Helios-Debugger.deploy.js 28 KB

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