Helios-Debugger.deploy.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  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;
  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(inspectedContext)._isBlockContext();
  40. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  41. return smalltalk.withContext(function($ctx2) {
  42. inspectedContext=_st(inspectedContext)._outerContext();
  43. inspectedContext;
  44. return _st(variables)._addAll_(_st(inspectedContext)._locals());
  45. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  46. $1=anInspector;
  47. _st($1)._setLabel_("Context");
  48. $2=_st($1)._setVariables_(variables);
  49. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables,inspectedContext:inspectedContext},smalltalk.HLContextInspectorDecorator)})},
  50. messageSends: ["new", "context", "addAll:", "locals", "whileTrue:", "outerContext", "isBlockContext", "setLabel:", "setVariables:"]}),
  51. smalltalk.HLContextInspectorDecorator);
  52. smalltalk.addMethod(
  53. smalltalk.method({
  54. selector: "on:",
  55. fn: function (aContext){
  56. var self=this;
  57. return smalltalk.withContext(function($ctx1) {
  58. var $2,$3,$1;
  59. $2=_st(self)._new();
  60. _st($2)._initializeFromContext_(aContext);
  61. $3=_st($2)._yourself();
  62. $1=$3;
  63. return $1;
  64. }, function($ctx1) {$ctx1.fill(self,"on:",{aContext:aContext},smalltalk.HLContextInspectorDecorator.klass)})},
  65. messageSends: ["initializeFromContext:", "new", "yourself"]}),
  66. smalltalk.HLContextInspectorDecorator.klass);
  67. smalltalk.addClass('HLDebugger', smalltalk.HLFocusableWidget, ['model', 'stackListWidget', 'codeWidget', 'inspectorWidget'], 'Helios-Debugger');
  68. smalltalk.addMethod(
  69. smalltalk.method({
  70. selector: "codeWidget",
  71. fn: function (){
  72. var self=this;
  73. function $HLBrowserCodeWidget(){return smalltalk.HLBrowserCodeWidget||(typeof HLBrowserCodeWidget=="undefined"?nil:HLBrowserCodeWidget)}
  74. return smalltalk.withContext(function($ctx1) {
  75. var $2,$3,$4,$1;
  76. $2=self["@codeWidget"];
  77. if(($receiver = $2) == nil || $receiver == undefined){
  78. $3=_st($HLBrowserCodeWidget())._new();
  79. _st($3)._browserModel_(_st(self)._model());
  80. $4=_st($3)._yourself();
  81. self["@codeWidget"]=$4;
  82. $1=self["@codeWidget"];
  83. } else {
  84. $1=$2;
  85. };
  86. return $1;
  87. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLDebugger)})},
  88. messageSends: ["ifNil:", "browserModel:", "model", "new", "yourself"]}),
  89. smalltalk.HLDebugger);
  90. smalltalk.addMethod(
  91. smalltalk.method({
  92. selector: "focus",
  93. fn: function (){
  94. var self=this;
  95. return smalltalk.withContext(function($ctx1) {
  96. _st(_st(self)._stackListWidget())._focus();
  97. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLDebugger)})},
  98. messageSends: ["focus", "stackListWidget"]}),
  99. smalltalk.HLDebugger);
  100. smalltalk.addMethod(
  101. smalltalk.method({
  102. selector: "initializeFromMethodContext:",
  103. fn: function (aMethodContext){
  104. var self=this;
  105. function $HLDebuggerModel(){return smalltalk.HLDebuggerModel||(typeof HLDebuggerModel=="undefined"?nil:HLDebuggerModel)}
  106. return smalltalk.withContext(function($ctx1) {
  107. self["@model"]=_st($HLDebuggerModel())._on_(aMethodContext);
  108. _st(self)._observeModel();
  109. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromMethodContext:",{aMethodContext:aMethodContext},smalltalk.HLDebugger)})},
  110. messageSends: ["on:", "observeModel"]}),
  111. smalltalk.HLDebugger);
  112. smalltalk.addMethod(
  113. smalltalk.method({
  114. selector: "inspectorWidget",
  115. fn: function (){
  116. var self=this;
  117. function $HLInspectorWidget(){return smalltalk.HLInspectorWidget||(typeof HLInspectorWidget=="undefined"?nil:HLInspectorWidget)}
  118. return smalltalk.withContext(function($ctx1) {
  119. var $2,$1;
  120. $2=self["@inspectorWidget"];
  121. if(($receiver = $2) == nil || $receiver == undefined){
  122. self["@inspectorWidget"]=_st($HLInspectorWidget())._new();
  123. $1=self["@inspectorWidget"];
  124. } else {
  125. $1=$2;
  126. };
  127. return $1;
  128. }, function($ctx1) {$ctx1.fill(self,"inspectorWidget",{},smalltalk.HLDebugger)})},
  129. messageSends: ["ifNil:", "new"]}),
  130. smalltalk.HLDebugger);
  131. smalltalk.addMethod(
  132. smalltalk.method({
  133. selector: "model",
  134. fn: function (){
  135. var self=this;
  136. function $HLDebuggerModel(){return smalltalk.HLDebuggerModel||(typeof HLDebuggerModel=="undefined"?nil:HLDebuggerModel)}
  137. return smalltalk.withContext(function($ctx1) {
  138. var $2,$1;
  139. $2=self["@model"];
  140. if(($receiver = $2) == nil || $receiver == undefined){
  141. self["@model"]=_st($HLDebuggerModel())._new();
  142. $1=self["@model"];
  143. } else {
  144. $1=$2;
  145. };
  146. return $1;
  147. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLDebugger)})},
  148. messageSends: ["ifNil:", "new"]}),
  149. smalltalk.HLDebugger);
  150. smalltalk.addMethod(
  151. smalltalk.method({
  152. selector: "observeModel",
  153. fn: function (){
  154. var self=this;
  155. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  156. return smalltalk.withContext(function($ctx1) {
  157. _st(_st(_st(self)._model())._announcer())._on_send_to_($HLDebuggerContextSelected(),"onContextSelected:",self);
  158. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLDebugger)})},
  159. messageSends: ["on:send:to:", "announcer", "model"]}),
  160. smalltalk.HLDebugger);
  161. smalltalk.addMethod(
  162. smalltalk.method({
  163. selector: "onContextSelected:",
  164. fn: function (anAnnouncement){
  165. var self=this;
  166. function $HLContextInspectorDecorator(){return smalltalk.HLContextInspectorDecorator||(typeof HLContextInspectorDecorator=="undefined"?nil:HLContextInspectorDecorator)}
  167. return smalltalk.withContext(function($ctx1) {
  168. _st(_st(self)._inspectorWidget())._inspect_(_st($HLContextInspectorDecorator())._on_(_st(anAnnouncement)._context()));
  169. return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLDebugger)})},
  170. messageSends: ["inspect:", "on:", "context", "inspectorWidget"]}),
  171. smalltalk.HLDebugger);
  172. smalltalk.addMethod(
  173. smalltalk.method({
  174. selector: "open",
  175. fn: function (){
  176. var self=this;
  177. function $HLTab(){return smalltalk.HLTab||(typeof HLTab=="undefined"?nil:HLTab)}
  178. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  179. return smalltalk.withContext(function($ctx1) {
  180. _st(_st($HLManager())._current())._addTab_(_st($HLTab())._on_labelled_(self,_st(_st(self)._class())._tabLabel()));
  181. return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.HLDebugger)})},
  182. messageSends: ["addTab:", "on:labelled:", "tabLabel", "class", "current"]}),
  183. smalltalk.HLDebugger);
  184. smalltalk.addMethod(
  185. smalltalk.method({
  186. selector: "renderContentOn:",
  187. fn: function (html){
  188. var self=this;
  189. function $HLVerticalSplitter(){return smalltalk.HLVerticalSplitter||(typeof HLVerticalSplitter=="undefined"?nil:HLVerticalSplitter)}
  190. function $HLHorizontalSplitter(){return smalltalk.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  191. function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  192. return smalltalk.withContext(function($ctx1) {
  193. _st(html)._with_(_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(_st(self)._stackListWidget(),_st($HLVerticalSplitter())._with_with_(_st(self)._codeWidget(),_st(self)._inspectorWidget()))));
  194. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLDebugger)})},
  195. messageSends: ["with:", "with:with:", "stackListWidget", "codeWidget", "inspectorWidget"]}),
  196. smalltalk.HLDebugger);
  197. smalltalk.addMethod(
  198. smalltalk.method({
  199. selector: "stackListWidget",
  200. fn: function (){
  201. var self=this;
  202. function $HLStackListWidget(){return smalltalk.HLStackListWidget||(typeof HLStackListWidget=="undefined"?nil:HLStackListWidget)}
  203. return smalltalk.withContext(function($ctx1) {
  204. var $2,$3,$4,$1;
  205. $2=self["@stackListWidget"];
  206. if(($receiver = $2) == nil || $receiver == undefined){
  207. $3=_st($HLStackListWidget())._on_(_st(self)._model());
  208. _st($3)._next_(_st(self)._codeWidget());
  209. $4=_st($3)._yourself();
  210. self["@stackListWidget"]=$4;
  211. $1=self["@stackListWidget"];
  212. } else {
  213. $1=$2;
  214. };
  215. return $1;
  216. }, function($ctx1) {$ctx1.fill(self,"stackListWidget",{},smalltalk.HLDebugger)})},
  217. messageSends: ["ifNil:", "next:", "codeWidget", "on:", "model", "yourself"]}),
  218. smalltalk.HLDebugger);
  219. smalltalk.addMethod(
  220. smalltalk.method({
  221. selector: "on:",
  222. fn: function (aMethodContext){
  223. var self=this;
  224. return smalltalk.withContext(function($ctx1) {
  225. var $2,$3,$1;
  226. $2=_st(self)._new();
  227. _st($2)._initializeFromMethodContext_(aMethodContext);
  228. $3=_st($2)._yourself();
  229. $1=$3;
  230. return $1;
  231. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},smalltalk.HLDebugger.klass)})},
  232. messageSends: ["initializeFromMethodContext:", "new", "yourself"]}),
  233. smalltalk.HLDebugger.klass);
  234. smalltalk.addMethod(
  235. smalltalk.method({
  236. selector: "tabLabel",
  237. fn: function (){
  238. var self=this;
  239. return smalltalk.withContext(function($ctx1) {
  240. return "Debugger";
  241. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLDebugger.klass)})},
  242. messageSends: []}),
  243. smalltalk.HLDebugger.klass);
  244. smalltalk.addClass('HLDebuggerModel', smalltalk.HLToolModel, ['rootContext', 'currentContext', 'contexts'], 'Helios-Debugger');
  245. smalltalk.addMethod(
  246. smalltalk.method({
  247. selector: "contexts",
  248. fn: function (){
  249. var self=this;
  250. return smalltalk.withContext(function($ctx1) {
  251. var $1;
  252. $1=self["@contexts"];
  253. return $1;
  254. }, function($ctx1) {$ctx1.fill(self,"contexts",{},smalltalk.HLDebuggerModel)})},
  255. messageSends: []}),
  256. smalltalk.HLDebuggerModel);
  257. smalltalk.addMethod(
  258. smalltalk.method({
  259. selector: "currentContext",
  260. fn: function (){
  261. var self=this;
  262. return smalltalk.withContext(function($ctx1) {
  263. var $1,$2;
  264. $1=self["@currentContext"];
  265. if(($receiver = $1) == nil || $receiver == undefined){
  266. _st(self)._currentContext_(_st(self)._rootContext());
  267. } else {
  268. $1;
  269. };
  270. $2=self["@currentContext"];
  271. return $2;
  272. }, function($ctx1) {$ctx1.fill(self,"currentContext",{},smalltalk.HLDebuggerModel)})},
  273. messageSends: ["ifNil:", "currentContext:", "rootContext"]}),
  274. smalltalk.HLDebuggerModel);
  275. smalltalk.addMethod(
  276. smalltalk.method({
  277. selector: "currentContext:",
  278. fn: function (aContext){
  279. var self=this;
  280. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  281. return smalltalk.withContext(function($ctx1) {
  282. var $1,$2;
  283. _st(self)._withChangesDo_((function(){
  284. return smalltalk.withContext(function($ctx2) {
  285. self["@currentContext"]=aContext;
  286. self["@currentContext"];
  287. $1=_st($HLDebuggerContextSelected())._new();
  288. _st($1)._context_(aContext);
  289. $2=_st($1)._yourself();
  290. _st(_st(self)._announcer())._announce_($2);
  291. return _st(self)._selectedMethod_(_st(aContext)._method());
  292. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  293. return self}, function($ctx1) {$ctx1.fill(self,"currentContext:",{aContext:aContext},smalltalk.HLDebuggerModel)})},
  294. messageSends: ["withChangesDo:", "announce:", "context:", "new", "yourself", "announcer", "selectedMethod:", "method"]}),
  295. smalltalk.HLDebuggerModel);
  296. smalltalk.addMethod(
  297. smalltalk.method({
  298. selector: "initializeContexts",
  299. fn: function (){
  300. var self=this;
  301. var context;
  302. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  303. return smalltalk.withContext(function($ctx1) {
  304. self["@contexts"]=_st($OrderedCollection())._new();
  305. context=_st(self)._rootContext();
  306. _st((function(){
  307. return smalltalk.withContext(function($ctx2) {
  308. return _st(context)._notNil();
  309. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  310. return smalltalk.withContext(function($ctx2) {
  311. _st(self["@contexts"])._add_(context);
  312. context=_st(context)._outerContext();
  313. return context;
  314. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  315. return self}, function($ctx1) {$ctx1.fill(self,"initializeContexts",{context:context},smalltalk.HLDebuggerModel)})},
  316. messageSends: ["new", "rootContext", "whileTrue:", "add:", "outerContext", "notNil"]}),
  317. smalltalk.HLDebuggerModel);
  318. smalltalk.addMethod(
  319. smalltalk.method({
  320. selector: "initializeFromContext:",
  321. fn: function (aMethodContext){
  322. var self=this;
  323. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  324. return smalltalk.withContext(function($ctx1) {
  325. self["@rootContext"]=_st($AIContext())._fromMethodContext_(aMethodContext);
  326. _st(self)._initializeContexts();
  327. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromContext:",{aMethodContext:aMethodContext},smalltalk.HLDebuggerModel)})},
  328. messageSends: ["fromMethodContext:", "initializeContexts"]}),
  329. smalltalk.HLDebuggerModel);
  330. smalltalk.addMethod(
  331. smalltalk.method({
  332. selector: "rootContext",
  333. fn: function (){
  334. var self=this;
  335. return smalltalk.withContext(function($ctx1) {
  336. var $1;
  337. $1=self["@rootContext"];
  338. return $1;
  339. }, function($ctx1) {$ctx1.fill(self,"rootContext",{},smalltalk.HLDebuggerModel)})},
  340. messageSends: []}),
  341. smalltalk.HLDebuggerModel);
  342. smalltalk.addMethod(
  343. smalltalk.method({
  344. selector: "on:",
  345. fn: function (aMethodContext){
  346. var self=this;
  347. return smalltalk.withContext(function($ctx1) {
  348. var $2,$3,$1;
  349. $2=_st(self)._new();
  350. _st($2)._initializeFromContext_(aMethodContext);
  351. $3=_st($2)._yourself();
  352. $1=$3;
  353. return $1;
  354. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},smalltalk.HLDebuggerModel.klass)})},
  355. messageSends: ["initializeFromContext:", "new", "yourself"]}),
  356. smalltalk.HLDebuggerModel.klass);
  357. smalltalk.addClass('HLStackListWidget', smalltalk.HLToolListWidget, [], 'Helios-Debugger');
  358. smalltalk.addMethod(
  359. smalltalk.method({
  360. selector: "items",
  361. fn: function (){
  362. var self=this;
  363. return smalltalk.withContext(function($ctx1) {
  364. var $2,$1;
  365. $2=self["@items"];
  366. if(($receiver = $2) == nil || $receiver == undefined){
  367. self["@items"]=_st(_st(self)._model())._contexts();
  368. $1=self["@items"];
  369. } else {
  370. $1=$2;
  371. };
  372. return $1;
  373. }, function($ctx1) {$ctx1.fill(self,"items",{},smalltalk.HLStackListWidget)})},
  374. messageSends: ["ifNil:", "contexts", "model"]}),
  375. smalltalk.HLStackListWidget);
  376. smalltalk.addMethod(
  377. smalltalk.method({
  378. selector: "label",
  379. fn: function (){
  380. var self=this;
  381. return smalltalk.withContext(function($ctx1) {
  382. return "Stack";
  383. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLStackListWidget)})},
  384. messageSends: []}),
  385. smalltalk.HLStackListWidget);
  386. smalltalk.addMethod(
  387. smalltalk.method({
  388. selector: "selectItem:",
  389. fn: function (aContext){
  390. var self=this;
  391. return smalltalk.withContext(function($ctx1) {
  392. _st(_st(self)._model())._currentContext_(aContext);
  393. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{aContext:aContext},smalltalk.HLStackListWidget)})},
  394. messageSends: ["currentContext:", "model"]}),
  395. smalltalk.HLStackListWidget);