Helios-Debugger.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. smalltalk.addPackage('Helios-Debugger');
  2. smalltalk.addClass('HLContextInspectorDecorator', smalltalk.Object, ['context'], 'Helios-Debugger');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "context",
  6. category: 'accessing',
  7. fn: function (){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx1) {
  10. var $1;
  11. $1=self["@context"];
  12. return $1;
  13. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.HLContextInspectorDecorator)})},
  14. args: [],
  15. source: "context\x0a\x09^ context",
  16. messageSends: [],
  17. referencedClasses: []
  18. }),
  19. smalltalk.HLContextInspectorDecorator);
  20. smalltalk.addMethod(
  21. smalltalk.method({
  22. selector: "initializeFromContext:",
  23. category: 'initialization',
  24. fn: function (aContext){
  25. var self=this;
  26. return smalltalk.withContext(function($ctx1) {
  27. self["@context"]=aContext;
  28. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromContext:",{aContext:aContext},smalltalk.HLContextInspectorDecorator)})},
  29. args: ["aContext"],
  30. source: "initializeFromContext: aContext\x0a\x09context := aContext",
  31. messageSends: [],
  32. referencedClasses: []
  33. }),
  34. smalltalk.HLContextInspectorDecorator);
  35. smalltalk.addMethod(
  36. smalltalk.method({
  37. selector: "inspectOn:",
  38. category: 'inspecting',
  39. fn: function (anInspector){
  40. var self=this;
  41. var variables,inspectedContext;
  42. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  43. return smalltalk.withContext(function($ctx1) {
  44. var $1,$2;
  45. variables=_st($Dictionary())._new();
  46. inspectedContext=_st(self)._context();
  47. _st(variables)._addAll_(_st(inspectedContext)._locals());
  48. _st((function(){
  49. return smalltalk.withContext(function($ctx2) {
  50. return _st(inspectedContext)._isBlockContext();
  51. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  52. return smalltalk.withContext(function($ctx2) {
  53. inspectedContext=_st(inspectedContext)._outerContext();
  54. inspectedContext;
  55. return _st(variables)._addAll_(_st(inspectedContext)._locals());
  56. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  57. $1=anInspector;
  58. _st($1)._setLabel_("Context");
  59. $2=_st($1)._setVariables_(variables);
  60. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables,inspectedContext:inspectedContext},smalltalk.HLContextInspectorDecorator)})},
  61. args: ["anInspector"],
  62. source: "inspectOn: anInspector\x0a\x09| variables inspectedContext |\x0a\x09\x0a\x09variables := Dictionary new.\x0a\x09inspectedContext := self context.\x0a\x09\x0a\x09variables addAll: inspectedContext locals.\x0a\x09\x0a\x09[ inspectedContext isBlockContext ] whileTrue: [\x0a\x09\x09inspectedContext := inspectedContext outerContext.\x0a\x09\x09variables addAll: inspectedContext locals ].\x0a\x09\x0a\x09anInspector\x0a\x09\x09setLabel: 'Context';\x0a\x09\x09setVariables: variables",
  63. messageSends: ["new", "context", "addAll:", "locals", "whileTrue:", "outerContext", "isBlockContext", "setLabel:", "setVariables:"],
  64. referencedClasses: ["Dictionary"]
  65. }),
  66. smalltalk.HLContextInspectorDecorator);
  67. smalltalk.addMethod(
  68. smalltalk.method({
  69. selector: "on:",
  70. category: 'instance creation',
  71. fn: function (aContext){
  72. var self=this;
  73. return smalltalk.withContext(function($ctx1) {
  74. var $2,$3,$1;
  75. $2=_st(self)._new();
  76. _st($2)._initializeFromContext_(aContext);
  77. $3=_st($2)._yourself();
  78. $1=$3;
  79. return $1;
  80. }, function($ctx1) {$ctx1.fill(self,"on:",{aContext:aContext},smalltalk.HLContextInspectorDecorator.klass)})},
  81. args: ["aContext"],
  82. source: "on: aContext\x0a\x09^ self new\x0a\x09\x09initializeFromContext: aContext;\x0a\x09\x09yourself",
  83. messageSends: ["initializeFromContext:", "new", "yourself"],
  84. referencedClasses: []
  85. }),
  86. smalltalk.HLContextInspectorDecorator.klass);
  87. smalltalk.addClass('HLDebugger', smalltalk.HLFocusableWidget, ['model', 'stackListWidget', 'codeWidget', 'inspectorWidget'], 'Helios-Debugger');
  88. smalltalk.HLDebugger.comment="I am the main widget for the Helios debugger."
  89. smalltalk.addMethod(
  90. smalltalk.method({
  91. selector: "codeWidget",
  92. category: 'accessing',
  93. fn: function (){
  94. var self=this;
  95. function $HLBrowserCodeWidget(){return smalltalk.HLBrowserCodeWidget||(typeof HLBrowserCodeWidget=="undefined"?nil:HLBrowserCodeWidget)}
  96. return smalltalk.withContext(function($ctx1) {
  97. var $2,$3,$4,$1;
  98. $2=self["@codeWidget"];
  99. if(($receiver = $2) == nil || $receiver == undefined){
  100. $3=_st($HLBrowserCodeWidget())._new();
  101. _st($3)._browserModel_(_st(self)._model());
  102. $4=_st($3)._yourself();
  103. self["@codeWidget"]=$4;
  104. $1=self["@codeWidget"];
  105. } else {
  106. $1=$2;
  107. };
  108. return $1;
  109. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLDebugger)})},
  110. args: [],
  111. source: "codeWidget\x0a\x09^ codeWidget ifNil: [ codeWidget := HLBrowserCodeWidget new\x0a\x09\x09browserModel: self model;\x0a\x09\x09yourself ]",
  112. messageSends: ["ifNil:", "browserModel:", "model", "new", "yourself"],
  113. referencedClasses: ["HLBrowserCodeWidget"]
  114. }),
  115. smalltalk.HLDebugger);
  116. smalltalk.addMethod(
  117. smalltalk.method({
  118. selector: "focus",
  119. category: 'actions',
  120. fn: function (){
  121. var self=this;
  122. return smalltalk.withContext(function($ctx1) {
  123. _st(_st(self)._stackListWidget())._focus();
  124. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLDebugger)})},
  125. args: [],
  126. source: "focus\x0a\x09self stackListWidget focus",
  127. messageSends: ["focus", "stackListWidget"],
  128. referencedClasses: []
  129. }),
  130. smalltalk.HLDebugger);
  131. smalltalk.addMethod(
  132. smalltalk.method({
  133. selector: "initializeFromMethodContext:",
  134. category: 'accessing',
  135. fn: function (aMethodContext){
  136. var self=this;
  137. function $HLDebuggerModel(){return smalltalk.HLDebuggerModel||(typeof HLDebuggerModel=="undefined"?nil:HLDebuggerModel)}
  138. return smalltalk.withContext(function($ctx1) {
  139. self["@model"]=_st($HLDebuggerModel())._on_(aMethodContext);
  140. _st(self)._observeModel();
  141. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromMethodContext:",{aMethodContext:aMethodContext},smalltalk.HLDebugger)})},
  142. args: ["aMethodContext"],
  143. source: "initializeFromMethodContext: aMethodContext\x0a\x09model := HLDebuggerModel on: aMethodContext.\x0a\x09self observeModel",
  144. messageSends: ["on:", "observeModel"],
  145. referencedClasses: ["HLDebuggerModel"]
  146. }),
  147. smalltalk.HLDebugger);
  148. smalltalk.addMethod(
  149. smalltalk.method({
  150. selector: "inspectorWidget",
  151. category: 'accessing',
  152. fn: function (){
  153. var self=this;
  154. function $HLInspectorWidget(){return smalltalk.HLInspectorWidget||(typeof HLInspectorWidget=="undefined"?nil:HLInspectorWidget)}
  155. return smalltalk.withContext(function($ctx1) {
  156. var $2,$1;
  157. $2=self["@inspectorWidget"];
  158. if(($receiver = $2) == nil || $receiver == undefined){
  159. self["@inspectorWidget"]=_st($HLInspectorWidget())._new();
  160. $1=self["@inspectorWidget"];
  161. } else {
  162. $1=$2;
  163. };
  164. return $1;
  165. }, function($ctx1) {$ctx1.fill(self,"inspectorWidget",{},smalltalk.HLDebugger)})},
  166. args: [],
  167. source: "inspectorWidget\x0a\x09^ inspectorWidget ifNil: [ \x0a\x09\x09inspectorWidget := HLInspectorWidget new ]",
  168. messageSends: ["ifNil:", "new"],
  169. referencedClasses: ["HLInspectorWidget"]
  170. }),
  171. smalltalk.HLDebugger);
  172. smalltalk.addMethod(
  173. smalltalk.method({
  174. selector: "model",
  175. category: 'accessing',
  176. fn: function (){
  177. var self=this;
  178. function $HLDebuggerModel(){return smalltalk.HLDebuggerModel||(typeof HLDebuggerModel=="undefined"?nil:HLDebuggerModel)}
  179. return smalltalk.withContext(function($ctx1) {
  180. var $2,$1;
  181. $2=self["@model"];
  182. if(($receiver = $2) == nil || $receiver == undefined){
  183. self["@model"]=_st($HLDebuggerModel())._new();
  184. $1=self["@model"];
  185. } else {
  186. $1=$2;
  187. };
  188. return $1;
  189. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLDebugger)})},
  190. args: [],
  191. source: "model\x0a\x09^ model ifNil: [ model := HLDebuggerModel new ]",
  192. messageSends: ["ifNil:", "new"],
  193. referencedClasses: ["HLDebuggerModel"]
  194. }),
  195. smalltalk.HLDebugger);
  196. smalltalk.addMethod(
  197. smalltalk.method({
  198. selector: "observeModel",
  199. category: 'actions',
  200. fn: function (){
  201. var self=this;
  202. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  203. return smalltalk.withContext(function($ctx1) {
  204. _st(_st(_st(self)._model())._announcer())._on_send_to_($HLDebuggerContextSelected(),"onContextSelected:",self);
  205. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLDebugger)})},
  206. args: [],
  207. source: "observeModel\x0a\x09self model announcer \x0a\x09\x09on: HLDebuggerContextSelected\x0a\x09\x09send: #onContextSelected:\x0a\x09\x09to: self",
  208. messageSends: ["on:send:to:", "announcer", "model"],
  209. referencedClasses: ["HLDebuggerContextSelected"]
  210. }),
  211. smalltalk.HLDebugger);
  212. smalltalk.addMethod(
  213. smalltalk.method({
  214. selector: "onContextSelected:",
  215. category: 'reactions',
  216. fn: function (anAnnouncement){
  217. var self=this;
  218. function $HLContextInspectorDecorator(){return smalltalk.HLContextInspectorDecorator||(typeof HLContextInspectorDecorator=="undefined"?nil:HLContextInspectorDecorator)}
  219. return smalltalk.withContext(function($ctx1) {
  220. _st(_st(self)._inspectorWidget())._inspect_(_st($HLContextInspectorDecorator())._on_(_st(anAnnouncement)._context()));
  221. return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLDebugger)})},
  222. args: ["anAnnouncement"],
  223. source: "onContextSelected: anAnnouncement\x0a\x09self inspectorWidget inspect: (HLContextInspectorDecorator on: anAnnouncement context)",
  224. messageSends: ["inspect:", "on:", "context", "inspectorWidget"],
  225. referencedClasses: ["HLContextInspectorDecorator"]
  226. }),
  227. smalltalk.HLDebugger);
  228. smalltalk.addMethod(
  229. smalltalk.method({
  230. selector: "open",
  231. category: 'rendering',
  232. fn: function (){
  233. var self=this;
  234. function $HLTab(){return smalltalk.HLTab||(typeof HLTab=="undefined"?nil:HLTab)}
  235. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  236. return smalltalk.withContext(function($ctx1) {
  237. _st(_st($HLManager())._current())._addTab_(_st($HLTab())._on_labelled_(self,_st(_st(self)._class())._tabLabel()));
  238. return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.HLDebugger)})},
  239. args: [],
  240. source: "open\x0a\x09HLManager current addTab: (HLTab on: self labelled: self class tabLabel)",
  241. messageSends: ["addTab:", "on:labelled:", "tabLabel", "class", "current"],
  242. referencedClasses: ["HLTab", "HLManager"]
  243. }),
  244. smalltalk.HLDebugger);
  245. smalltalk.addMethod(
  246. smalltalk.method({
  247. selector: "renderContentOn:",
  248. category: 'rendering',
  249. fn: function (html){
  250. var self=this;
  251. function $HLVerticalSplitter(){return smalltalk.HLVerticalSplitter||(typeof HLVerticalSplitter=="undefined"?nil:HLVerticalSplitter)}
  252. function $HLHorizontalSplitter(){return smalltalk.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  253. function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  254. return smalltalk.withContext(function($ctx1) {
  255. _st(html)._with_(_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(_st(self)._stackListWidget(),_st($HLVerticalSplitter())._with_with_(_st(self)._codeWidget(),_st(self)._inspectorWidget()))));
  256. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLDebugger)})},
  257. args: ["html"],
  258. source: "renderContentOn: html\x0a\x09html with: (HLContainer with: (HLHorizontalSplitter\x0a\x09\x09with: self stackListWidget\x0a\x09\x09with: (HLVerticalSplitter\x0a\x09\x09\x09with: self codeWidget\x0a\x09\x09\x09with: self inspectorWidget)))",
  259. messageSends: ["with:", "with:with:", "stackListWidget", "codeWidget", "inspectorWidget"],
  260. referencedClasses: ["HLVerticalSplitter", "HLHorizontalSplitter", "HLContainer"]
  261. }),
  262. smalltalk.HLDebugger);
  263. smalltalk.addMethod(
  264. smalltalk.method({
  265. selector: "stackListWidget",
  266. category: 'accessing',
  267. fn: function (){
  268. var self=this;
  269. function $HLStackListWidget(){return smalltalk.HLStackListWidget||(typeof HLStackListWidget=="undefined"?nil:HLStackListWidget)}
  270. return smalltalk.withContext(function($ctx1) {
  271. var $2,$3,$4,$1;
  272. $2=self["@stackListWidget"];
  273. if(($receiver = $2) == nil || $receiver == undefined){
  274. $3=_st($HLStackListWidget())._on_(_st(self)._model());
  275. _st($3)._next_(_st(self)._codeWidget());
  276. $4=_st($3)._yourself();
  277. self["@stackListWidget"]=$4;
  278. $1=self["@stackListWidget"];
  279. } else {
  280. $1=$2;
  281. };
  282. return $1;
  283. }, function($ctx1) {$ctx1.fill(self,"stackListWidget",{},smalltalk.HLDebugger)})},
  284. args: [],
  285. source: "stackListWidget\x0a\x09^ stackListWidget ifNil: [ \x0a\x09\x09stackListWidget := (HLStackListWidget on: self model)\x0a\x09\x09\x09next: self codeWidget;\x0a\x09\x09\x09yourself ]",
  286. messageSends: ["ifNil:", "next:", "codeWidget", "on:", "model", "yourself"],
  287. referencedClasses: ["HLStackListWidget"]
  288. }),
  289. smalltalk.HLDebugger);
  290. smalltalk.addMethod(
  291. smalltalk.method({
  292. selector: "on:",
  293. category: 'instance creation',
  294. fn: function (aMethodContext){
  295. var self=this;
  296. return smalltalk.withContext(function($ctx1) {
  297. var $2,$3,$1;
  298. $2=_st(self)._new();
  299. _st($2)._initializeFromMethodContext_(aMethodContext);
  300. $3=_st($2)._yourself();
  301. $1=$3;
  302. return $1;
  303. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},smalltalk.HLDebugger.klass)})},
  304. args: ["aMethodContext"],
  305. source: "on: aMethodContext\x0a\x09^ self new\x0a\x09\x09initializeFromMethodContext: aMethodContext;\x0a\x09\x09yourself",
  306. messageSends: ["initializeFromMethodContext:", "new", "yourself"],
  307. referencedClasses: []
  308. }),
  309. smalltalk.HLDebugger.klass);
  310. smalltalk.addMethod(
  311. smalltalk.method({
  312. selector: "tabLabel",
  313. category: 'accessing',
  314. fn: function (){
  315. var self=this;
  316. return smalltalk.withContext(function($ctx1) {
  317. return "Debugger";
  318. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLDebugger.klass)})},
  319. args: [],
  320. source: "tabLabel\x0a\x09^ 'Debugger'",
  321. messageSends: [],
  322. referencedClasses: []
  323. }),
  324. smalltalk.HLDebugger.klass);
  325. smalltalk.addClass('HLDebuggerModel', smalltalk.HLToolModel, ['rootContext', 'currentContext', 'contexts'], 'Helios-Debugger');
  326. smalltalk.HLDebuggerModel.comment="I am a model for Helios debugging.\x0a\x0aMy instances hold a reference to an `AIContext` instance, built from a `MethodContext`. The context should be the root of the context stack."
  327. smalltalk.addMethod(
  328. smalltalk.method({
  329. selector: "contexts",
  330. category: 'accessing',
  331. fn: function (){
  332. var self=this;
  333. return smalltalk.withContext(function($ctx1) {
  334. var $1;
  335. $1=self["@contexts"];
  336. return $1;
  337. }, function($ctx1) {$ctx1.fill(self,"contexts",{},smalltalk.HLDebuggerModel)})},
  338. args: [],
  339. source: "contexts\x0a\x09^ contexts",
  340. messageSends: [],
  341. referencedClasses: []
  342. }),
  343. smalltalk.HLDebuggerModel);
  344. smalltalk.addMethod(
  345. smalltalk.method({
  346. selector: "currentContext",
  347. category: 'accessing',
  348. fn: function (){
  349. var self=this;
  350. return smalltalk.withContext(function($ctx1) {
  351. var $1,$2;
  352. $1=self["@currentContext"];
  353. if(($receiver = $1) == nil || $receiver == undefined){
  354. _st(self)._currentContext_(_st(self)._rootContext());
  355. } else {
  356. $1;
  357. };
  358. $2=self["@currentContext"];
  359. return $2;
  360. }, function($ctx1) {$ctx1.fill(self,"currentContext",{},smalltalk.HLDebuggerModel)})},
  361. args: [],
  362. source: "currentContext\x0a\x09currentContext ifNil: [ self currentContext: self rootContext ].\x0a\x09^ currentContext",
  363. messageSends: ["ifNil:", "currentContext:", "rootContext"],
  364. referencedClasses: []
  365. }),
  366. smalltalk.HLDebuggerModel);
  367. smalltalk.addMethod(
  368. smalltalk.method({
  369. selector: "currentContext:",
  370. category: 'accessing',
  371. fn: function (aContext){
  372. var self=this;
  373. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  374. return smalltalk.withContext(function($ctx1) {
  375. var $1,$2;
  376. _st(self)._withChangesDo_((function(){
  377. return smalltalk.withContext(function($ctx2) {
  378. self["@currentContext"]=aContext;
  379. self["@currentContext"];
  380. $1=_st($HLDebuggerContextSelected())._new();
  381. _st($1)._context_(aContext);
  382. $2=_st($1)._yourself();
  383. _st(_st(self)._announcer())._announce_($2);
  384. return _st(self)._selectedMethod_(_st(aContext)._method());
  385. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  386. return self}, function($ctx1) {$ctx1.fill(self,"currentContext:",{aContext:aContext},smalltalk.HLDebuggerModel)})},
  387. args: ["aContext"],
  388. source: "currentContext: aContext\x0a\x09self withChangesDo: [ \x0a\x09\x09currentContext := aContext.\x0a\x09\x09self announcer announce: (HLDebuggerContextSelected new\x0a\x09\x09\x09context: aContext;\x0a\x09\x09\x09yourself).\x0a\x09\x09self selectedMethod: aContext method ]",
  389. messageSends: ["withChangesDo:", "announce:", "context:", "new", "yourself", "announcer", "selectedMethod:", "method"],
  390. referencedClasses: ["HLDebuggerContextSelected"]
  391. }),
  392. smalltalk.HLDebuggerModel);
  393. smalltalk.addMethod(
  394. smalltalk.method({
  395. selector: "initializeContexts",
  396. category: 'initialization',
  397. fn: function (){
  398. var self=this;
  399. var context;
  400. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  401. return smalltalk.withContext(function($ctx1) {
  402. self["@contexts"]=_st($OrderedCollection())._new();
  403. context=_st(self)._rootContext();
  404. _st((function(){
  405. return smalltalk.withContext(function($ctx2) {
  406. return _st(context)._notNil();
  407. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  408. return smalltalk.withContext(function($ctx2) {
  409. _st(self["@contexts"])._add_(context);
  410. context=_st(context)._outerContext();
  411. return context;
  412. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  413. return self}, function($ctx1) {$ctx1.fill(self,"initializeContexts",{context:context},smalltalk.HLDebuggerModel)})},
  414. args: [],
  415. source: "initializeContexts\x0a\x09\x22Flatten the context stack into an OrderedCollection\x22\x0a\x09\x0a\x09| context |\x0a\x09\x0a\x09contexts := OrderedCollection new.\x0a\x09context := self rootContext.\x0a\x09\x0a\x09[ context notNil ] whileTrue: [\x0a\x09\x09contexts add: context.\x0a\x09\x09context := context outerContext ]",
  416. messageSends: ["new", "rootContext", "whileTrue:", "add:", "outerContext", "notNil"],
  417. referencedClasses: ["OrderedCollection"]
  418. }),
  419. smalltalk.HLDebuggerModel);
  420. smalltalk.addMethod(
  421. smalltalk.method({
  422. selector: "initializeFromContext:",
  423. category: 'initialization',
  424. fn: function (aMethodContext){
  425. var self=this;
  426. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  427. return smalltalk.withContext(function($ctx1) {
  428. self["@rootContext"]=_st($AIContext())._fromMethodContext_(aMethodContext);
  429. _st(self)._initializeContexts();
  430. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromContext:",{aMethodContext:aMethodContext},smalltalk.HLDebuggerModel)})},
  431. args: ["aMethodContext"],
  432. source: "initializeFromContext: aMethodContext\x0a\x09rootContext := AIContext fromMethodContext: aMethodContext.\x0a\x09self initializeContexts",
  433. messageSends: ["fromMethodContext:", "initializeContexts"],
  434. referencedClasses: ["AIContext"]
  435. }),
  436. smalltalk.HLDebuggerModel);
  437. smalltalk.addMethod(
  438. smalltalk.method({
  439. selector: "rootContext",
  440. category: 'accessing',
  441. fn: function (){
  442. var self=this;
  443. return smalltalk.withContext(function($ctx1) {
  444. var $1;
  445. $1=self["@rootContext"];
  446. return $1;
  447. }, function($ctx1) {$ctx1.fill(self,"rootContext",{},smalltalk.HLDebuggerModel)})},
  448. args: [],
  449. source: "rootContext\x0a\x09^ rootContext",
  450. messageSends: [],
  451. referencedClasses: []
  452. }),
  453. smalltalk.HLDebuggerModel);
  454. smalltalk.addMethod(
  455. smalltalk.method({
  456. selector: "on:",
  457. category: 'instance creation',
  458. fn: function (aMethodContext){
  459. var self=this;
  460. return smalltalk.withContext(function($ctx1) {
  461. var $2,$3,$1;
  462. $2=_st(self)._new();
  463. _st($2)._initializeFromContext_(aMethodContext);
  464. $3=_st($2)._yourself();
  465. $1=$3;
  466. return $1;
  467. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},smalltalk.HLDebuggerModel.klass)})},
  468. args: ["aMethodContext"],
  469. source: "on: aMethodContext\x0a\x09^ self new\x0a\x09\x09initializeFromContext: aMethodContext;\x0a\x09\x09yourself",
  470. messageSends: ["initializeFromContext:", "new", "yourself"],
  471. referencedClasses: []
  472. }),
  473. smalltalk.HLDebuggerModel.klass);
  474. smalltalk.addClass('HLStackListWidget', smalltalk.HLToolListWidget, [], 'Helios-Debugger');
  475. smalltalk.addMethod(
  476. smalltalk.method({
  477. selector: "items",
  478. category: 'accessing',
  479. fn: function (){
  480. var self=this;
  481. return smalltalk.withContext(function($ctx1) {
  482. var $2,$1;
  483. $2=self["@items"];
  484. if(($receiver = $2) == nil || $receiver == undefined){
  485. self["@items"]=_st(_st(self)._model())._contexts();
  486. $1=self["@items"];
  487. } else {
  488. $1=$2;
  489. };
  490. return $1;
  491. }, function($ctx1) {$ctx1.fill(self,"items",{},smalltalk.HLStackListWidget)})},
  492. args: [],
  493. source: "items\x0a\x09^ items ifNil: [ items := self model contexts ]",
  494. messageSends: ["ifNil:", "contexts", "model"],
  495. referencedClasses: []
  496. }),
  497. smalltalk.HLStackListWidget);
  498. smalltalk.addMethod(
  499. smalltalk.method({
  500. selector: "label",
  501. category: 'accessing',
  502. fn: function (){
  503. var self=this;
  504. return smalltalk.withContext(function($ctx1) {
  505. return "Stack";
  506. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLStackListWidget)})},
  507. args: [],
  508. source: "label\x0a\x09^ 'Stack'",
  509. messageSends: [],
  510. referencedClasses: []
  511. }),
  512. smalltalk.HLStackListWidget);
  513. smalltalk.addMethod(
  514. smalltalk.method({
  515. selector: "selectItem:",
  516. category: 'actions',
  517. fn: function (aContext){
  518. var self=this;
  519. return smalltalk.withContext(function($ctx1) {
  520. _st(_st(self)._model())._currentContext_(aContext);
  521. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{aContext:aContext},smalltalk.HLStackListWidget)})},
  522. args: ["aContext"],
  523. source: "selectItem: aContext\x0a \x09self model currentContext: aContext",
  524. messageSends: ["currentContext:", "model"],
  525. referencedClasses: []
  526. }),
  527. smalltalk.HLStackListWidget);