Helios-Debugger.js 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248
  1. define("amber_core/Helios-Debugger", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Objects", "amber_core/Helios-Core", "amber_core/Helios-Workspace"], function(smalltalk,nil,_st, globals){
  2. smalltalk.addPackage('Helios-Debugger');
  3. smalltalk.packages["Helios-Debugger"].transport = {"type":"amd","amdNamespace":"amber_core"};
  4. smalltalk.addClass('HLContextInspectorDecorator', globals.Object, ['context'], 'Helios-Debugger');
  5. smalltalk.addMethod(
  6. smalltalk.method({
  7. selector: "context",
  8. protocol: 'accessing',
  9. fn: function (){
  10. var self=this;
  11. var $1;
  12. $1=self["@context"];
  13. return $1;
  14. },
  15. args: [],
  16. source: "context\x0a\x09^ context",
  17. messageSends: [],
  18. referencedClasses: []
  19. }),
  20. globals.HLContextInspectorDecorator);
  21. smalltalk.addMethod(
  22. smalltalk.method({
  23. selector: "initializeFromContext:",
  24. protocol: 'initialization',
  25. fn: function (aContext){
  26. var self=this;
  27. self["@context"]=aContext;
  28. return self},
  29. args: ["aContext"],
  30. source: "initializeFromContext: aContext\x0a\x09context := aContext",
  31. messageSends: [],
  32. referencedClasses: []
  33. }),
  34. globals.HLContextInspectorDecorator);
  35. smalltalk.addMethod(
  36. smalltalk.method({
  37. selector: "inspectOn:",
  38. protocol: 'inspecting',
  39. fn: function (anInspector){
  40. var self=this;
  41. var variables,inspectedContext;
  42. function $Dictionary(){return globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  43. return smalltalk.withContext(function($ctx1) {
  44. var $1,$2,$3,$4;
  45. variables=_st($Dictionary())._new();
  46. inspectedContext=self._context();
  47. $1=variables;
  48. $2=_st(inspectedContext)._locals();
  49. $ctx1.sendIdx["locals"]=1;
  50. _st($1)._addAll_($2);
  51. $ctx1.sendIdx["addAll:"]=1;
  52. _st((function(){
  53. return smalltalk.withContext(function($ctx2) {
  54. return _st(_st(inspectedContext)._notNil())._and_((function(){
  55. return smalltalk.withContext(function($ctx3) {
  56. return _st(inspectedContext)._isBlockContext();
  57. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  58. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileTrue_((function(){
  59. return smalltalk.withContext(function($ctx2) {
  60. inspectedContext=_st(inspectedContext)._outerContext();
  61. inspectedContext;
  62. $3=inspectedContext;
  63. if(($receiver = $3) == nil || $receiver == null){
  64. return $3;
  65. } else {
  66. return _st(variables)._addAll_(_st(inspectedContext)._locals());
  67. };
  68. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  69. _st(anInspector)._setLabel_("Context");
  70. $4=_st(anInspector)._setVariables_(variables);
  71. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables,inspectedContext:inspectedContext},globals.HLContextInspectorDecorator)})},
  72. args: ["anInspector"],
  73. 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 notNil and: [ inspectedContext isBlockContext ] ] whileTrue: [\x0a\x09\x09inspectedContext := inspectedContext outerContext.\x0a\x09\x09inspectedContext ifNotNil: [\x0a\x09\x09\x09variables addAll: inspectedContext locals ] ].\x0a\x09\x0a\x09anInspector\x0a\x09\x09setLabel: 'Context';\x0a\x09\x09setVariables: variables",
  74. messageSends: ["new", "context", "addAll:", "locals", "whileTrue:", "and:", "notNil", "isBlockContext", "outerContext", "ifNotNil:", "setLabel:", "setVariables:"],
  75. referencedClasses: ["Dictionary"]
  76. }),
  77. globals.HLContextInspectorDecorator);
  78. smalltalk.addMethod(
  79. smalltalk.method({
  80. selector: "on:",
  81. protocol: 'instance creation',
  82. fn: function (aContext){
  83. var self=this;
  84. return smalltalk.withContext(function($ctx1) {
  85. var $2,$3,$1;
  86. $2=self._new();
  87. _st($2)._initializeFromContext_(aContext);
  88. $3=_st($2)._yourself();
  89. $1=$3;
  90. return $1;
  91. }, function($ctx1) {$ctx1.fill(self,"on:",{aContext:aContext},globals.HLContextInspectorDecorator.klass)})},
  92. args: ["aContext"],
  93. source: "on: aContext\x0a\x09^ self new\x0a\x09\x09initializeFromContext: aContext;\x0a\x09\x09yourself",
  94. messageSends: ["initializeFromContext:", "new", "yourself"],
  95. referencedClasses: []
  96. }),
  97. globals.HLContextInspectorDecorator.klass);
  98. smalltalk.addClass('HLDebugger', globals.HLFocusableWidget, ['model', 'stackListWidget', 'codeWidget', 'inspectorWidget'], 'Helios-Debugger');
  99. globals.HLDebugger.comment="I am the main widget for the Helios debugger.";
  100. smalltalk.addMethod(
  101. smalltalk.method({
  102. selector: "codeWidget",
  103. protocol: 'accessing',
  104. fn: function (){
  105. var self=this;
  106. function $HLDebuggerCodeWidget(){return globals.HLDebuggerCodeWidget||(typeof HLDebuggerCodeWidget=="undefined"?nil:HLDebuggerCodeWidget)}
  107. function $HLDebuggerCodeModel(){return globals.HLDebuggerCodeModel||(typeof HLDebuggerCodeModel=="undefined"?nil:HLDebuggerCodeModel)}
  108. return smalltalk.withContext(function($ctx1) {
  109. var $2,$3,$4,$6,$7,$8,$9,$5,$10,$1;
  110. $2=self["@codeWidget"];
  111. if(($receiver = $2) == nil || $receiver == null){
  112. $3=_st($HLDebuggerCodeWidget())._new();
  113. $ctx1.sendIdx["new"]=1;
  114. $4=$3;
  115. $6=_st($HLDebuggerCodeModel())._new();
  116. $7=$6;
  117. $8=self._model();
  118. $ctx1.sendIdx["model"]=1;
  119. _st($7)._debuggerModel_($8);
  120. $9=_st($6)._yourself();
  121. $ctx1.sendIdx["yourself"]=1;
  122. $5=$9;
  123. _st($4)._model_($5);
  124. _st($3)._browserModel_(self._model());
  125. $10=_st($3)._yourself();
  126. self["@codeWidget"]=$10;
  127. $1=self["@codeWidget"];
  128. } else {
  129. $1=$2;
  130. };
  131. return $1;
  132. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},globals.HLDebugger)})},
  133. args: [],
  134. source: "codeWidget\x0a\x09^ codeWidget ifNil: [ codeWidget := HLDebuggerCodeWidget new\x0a\x09\x09model: (HLDebuggerCodeModel new\x0a\x09\x09\x09debuggerModel: self model;\x0a\x09\x09\x09yourself);\x0a\x09\x09browserModel: self model;\x0a\x09\x09yourself ]",
  135. messageSends: ["ifNil:", "model:", "new", "debuggerModel:", "model", "yourself", "browserModel:"],
  136. referencedClasses: ["HLDebuggerCodeWidget", "HLDebuggerCodeModel"]
  137. }),
  138. globals.HLDebugger);
  139. smalltalk.addMethod(
  140. smalltalk.method({
  141. selector: "focus",
  142. protocol: 'actions',
  143. fn: function (){
  144. var self=this;
  145. return smalltalk.withContext(function($ctx1) {
  146. _st(self._stackListWidget())._focus();
  147. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},globals.HLDebugger)})},
  148. args: [],
  149. source: "focus\x0a\x09self stackListWidget focus",
  150. messageSends: ["focus", "stackListWidget"],
  151. referencedClasses: []
  152. }),
  153. globals.HLDebugger);
  154. smalltalk.addMethod(
  155. smalltalk.method({
  156. selector: "initializeFromMethodContext:",
  157. protocol: 'accessing',
  158. fn: function (aMethodContext){
  159. var self=this;
  160. function $HLDebuggerModel(){return globals.HLDebuggerModel||(typeof HLDebuggerModel=="undefined"?nil:HLDebuggerModel)}
  161. return smalltalk.withContext(function($ctx1) {
  162. self["@model"]=_st($HLDebuggerModel())._on_(aMethodContext);
  163. self._observeModel();
  164. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromMethodContext:",{aMethodContext:aMethodContext},globals.HLDebugger)})},
  165. args: ["aMethodContext"],
  166. source: "initializeFromMethodContext: aMethodContext\x0a\x09model := HLDebuggerModel on: aMethodContext.\x0a\x09self observeModel",
  167. messageSends: ["on:", "observeModel"],
  168. referencedClasses: ["HLDebuggerModel"]
  169. }),
  170. globals.HLDebugger);
  171. smalltalk.addMethod(
  172. smalltalk.method({
  173. selector: "inspectorWidget",
  174. protocol: 'accessing',
  175. fn: function (){
  176. var self=this;
  177. function $HLInspectorWidget(){return globals.HLInspectorWidget||(typeof HLInspectorWidget=="undefined"?nil:HLInspectorWidget)}
  178. return smalltalk.withContext(function($ctx1) {
  179. var $2,$1;
  180. $2=self["@inspectorWidget"];
  181. if(($receiver = $2) == nil || $receiver == null){
  182. self["@inspectorWidget"]=_st($HLInspectorWidget())._new();
  183. $1=self["@inspectorWidget"];
  184. } else {
  185. $1=$2;
  186. };
  187. return $1;
  188. }, function($ctx1) {$ctx1.fill(self,"inspectorWidget",{},globals.HLDebugger)})},
  189. args: [],
  190. source: "inspectorWidget\x0a\x09^ inspectorWidget ifNil: [ \x0a\x09\x09inspectorWidget := HLInspectorWidget new ]",
  191. messageSends: ["ifNil:", "new"],
  192. referencedClasses: ["HLInspectorWidget"]
  193. }),
  194. globals.HLDebugger);
  195. smalltalk.addMethod(
  196. smalltalk.method({
  197. selector: "model",
  198. protocol: 'accessing',
  199. fn: function (){
  200. var self=this;
  201. function $HLDebuggerModel(){return globals.HLDebuggerModel||(typeof HLDebuggerModel=="undefined"?nil:HLDebuggerModel)}
  202. return smalltalk.withContext(function($ctx1) {
  203. var $2,$1;
  204. $2=self["@model"];
  205. if(($receiver = $2) == nil || $receiver == null){
  206. self["@model"]=_st($HLDebuggerModel())._new();
  207. $1=self["@model"];
  208. } else {
  209. $1=$2;
  210. };
  211. return $1;
  212. }, function($ctx1) {$ctx1.fill(self,"model",{},globals.HLDebugger)})},
  213. args: [],
  214. source: "model\x0a\x09^ model ifNil: [ model := HLDebuggerModel new ]",
  215. messageSends: ["ifNil:", "new"],
  216. referencedClasses: ["HLDebuggerModel"]
  217. }),
  218. globals.HLDebugger);
  219. smalltalk.addMethod(
  220. smalltalk.method({
  221. selector: "observeModel",
  222. protocol: 'actions',
  223. fn: function (){
  224. var self=this;
  225. function $HLDebuggerContextSelected(){return globals.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  226. function $HLDebuggerStepped(){return globals.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  227. return smalltalk.withContext(function($ctx1) {
  228. var $2,$1;
  229. $2=self._model();
  230. $ctx1.sendIdx["model"]=1;
  231. $1=_st($2)._announcer();
  232. $ctx1.sendIdx["announcer"]=1;
  233. _st($1)._on_send_to_($HLDebuggerContextSelected(),"onContextSelected:",self);
  234. $ctx1.sendIdx["on:send:to:"]=1;
  235. _st(_st(self._model())._announcer())._on_send_to_($HLDebuggerStepped(),"onContextSelected:",self);
  236. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},globals.HLDebugger)})},
  237. args: [],
  238. source: "observeModel\x0a\x09self model announcer \x0a\x09\x09on: HLDebuggerContextSelected\x0a\x09\x09send: #onContextSelected:\x0a\x09\x09to: self.\x0a\x09\x09\x0a\x09self model announcer \x0a\x09\x09on: HLDebuggerStepped\x0a\x09\x09send: #onContextSelected:\x0a\x09\x09to: self",
  239. messageSends: ["on:send:to:", "announcer", "model"],
  240. referencedClasses: ["HLDebuggerContextSelected", "HLDebuggerStepped"]
  241. }),
  242. globals.HLDebugger);
  243. smalltalk.addMethod(
  244. smalltalk.method({
  245. selector: "onContextSelected:",
  246. protocol: 'reactions',
  247. fn: function (anAnnouncement){
  248. var self=this;
  249. function $HLContextInspectorDecorator(){return globals.HLContextInspectorDecorator||(typeof HLContextInspectorDecorator=="undefined"?nil:HLContextInspectorDecorator)}
  250. return smalltalk.withContext(function($ctx1) {
  251. _st(self._inspectorWidget())._inspect_(_st($HLContextInspectorDecorator())._on_(_st(anAnnouncement)._context()));
  252. return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected:",{anAnnouncement:anAnnouncement},globals.HLDebugger)})},
  253. args: ["anAnnouncement"],
  254. source: "onContextSelected: anAnnouncement\x0a\x09self inspectorWidget inspect: (HLContextInspectorDecorator on: anAnnouncement context)",
  255. messageSends: ["inspect:", "inspectorWidget", "on:", "context"],
  256. referencedClasses: ["HLContextInspectorDecorator"]
  257. }),
  258. globals.HLDebugger);
  259. smalltalk.addMethod(
  260. smalltalk.method({
  261. selector: "registerBindingsOn:",
  262. protocol: 'keybindings',
  263. fn: function (aBindingGroup){
  264. var self=this;
  265. function $HLToolCommand(){return globals.HLToolCommand||(typeof HLToolCommand=="undefined"?nil:HLToolCommand)}
  266. return smalltalk.withContext(function($ctx1) {
  267. _st($HLToolCommand())._registerConcreteClassesOn_for_(aBindingGroup,self._model());
  268. return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup},globals.HLDebugger)})},
  269. args: ["aBindingGroup"],
  270. source: "registerBindingsOn: aBindingGroup\x0a\x09HLToolCommand \x0a\x09\x09registerConcreteClassesOn: aBindingGroup \x0a\x09\x09for: self model",
  271. messageSends: ["registerConcreteClassesOn:for:", "model"],
  272. referencedClasses: ["HLToolCommand"]
  273. }),
  274. globals.HLDebugger);
  275. smalltalk.addMethod(
  276. smalltalk.method({
  277. selector: "renderContentOn:",
  278. protocol: 'rendering',
  279. fn: function (html){
  280. var self=this;
  281. function $HLContainer(){return globals.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  282. function $HLHorizontalSplitter(){return globals.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  283. function $HLVerticalSplitter(){return globals.HLVerticalSplitter||(typeof HLVerticalSplitter=="undefined"?nil:HLVerticalSplitter)}
  284. return smalltalk.withContext(function($ctx1) {
  285. var $2,$1;
  286. $2=_st($HLHorizontalSplitter())._with_with_(self._stackListWidget(),_st($HLVerticalSplitter())._with_with_(self._codeWidget(),self._inspectorWidget()));
  287. $ctx1.sendIdx["with:with:"]=1;
  288. $1=_st($HLContainer())._with_($2);
  289. _st(html)._with_($1);
  290. $ctx1.sendIdx["with:"]=1;
  291. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLDebugger)})},
  292. args: ["html"],
  293. 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)))",
  294. messageSends: ["with:", "with:with:", "stackListWidget", "codeWidget", "inspectorWidget"],
  295. referencedClasses: ["HLContainer", "HLHorizontalSplitter", "HLVerticalSplitter"]
  296. }),
  297. globals.HLDebugger);
  298. smalltalk.addMethod(
  299. smalltalk.method({
  300. selector: "stackListWidget",
  301. protocol: 'accessing',
  302. fn: function (){
  303. var self=this;
  304. function $HLStackListWidget(){return globals.HLStackListWidget||(typeof HLStackListWidget=="undefined"?nil:HLStackListWidget)}
  305. return smalltalk.withContext(function($ctx1) {
  306. var $2,$3,$4,$1;
  307. $2=self["@stackListWidget"];
  308. if(($receiver = $2) == nil || $receiver == null){
  309. $3=_st($HLStackListWidget())._on_(self._model());
  310. _st($3)._next_(self._codeWidget());
  311. $4=_st($3)._yourself();
  312. self["@stackListWidget"]=$4;
  313. $1=self["@stackListWidget"];
  314. } else {
  315. $1=$2;
  316. };
  317. return $1;
  318. }, function($ctx1) {$ctx1.fill(self,"stackListWidget",{},globals.HLDebugger)})},
  319. args: [],
  320. source: "stackListWidget\x0a\x09^ stackListWidget ifNil: [ \x0a\x09\x09stackListWidget := (HLStackListWidget on: self model)\x0a\x09\x09\x09next: self codeWidget;\x0a\x09\x09\x09yourself ]",
  321. messageSends: ["ifNil:", "next:", "on:", "model", "codeWidget", "yourself"],
  322. referencedClasses: ["HLStackListWidget"]
  323. }),
  324. globals.HLDebugger);
  325. smalltalk.addMethod(
  326. smalltalk.method({
  327. selector: "unregister",
  328. protocol: 'actions',
  329. fn: function (){
  330. var self=this;
  331. return smalltalk.withContext(function($ctx1) {
  332. globals.HLDebugger.superclass.fn.prototype._unregister.apply(_st(self), []);
  333. $ctx1.sendIdx["unregister"]=1;
  334. _st(self._inspectorWidget())._unregister();
  335. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLDebugger)})},
  336. args: [],
  337. source: "unregister\x0a\x09super unregister.\x0a\x09self inspectorWidget unregister",
  338. messageSends: ["unregister", "inspectorWidget"],
  339. referencedClasses: []
  340. }),
  341. globals.HLDebugger);
  342. smalltalk.addMethod(
  343. smalltalk.method({
  344. selector: "on:",
  345. protocol: 'instance creation',
  346. fn: function (aMethodContext){
  347. var self=this;
  348. return smalltalk.withContext(function($ctx1) {
  349. var $2,$3,$1;
  350. $2=self._new();
  351. _st($2)._initializeFromMethodContext_(aMethodContext);
  352. $3=_st($2)._yourself();
  353. $1=$3;
  354. return $1;
  355. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},globals.HLDebugger.klass)})},
  356. args: ["aMethodContext"],
  357. source: "on: aMethodContext\x0a\x09^ self new\x0a\x09\x09initializeFromMethodContext: aMethodContext;\x0a\x09\x09yourself",
  358. messageSends: ["initializeFromMethodContext:", "new", "yourself"],
  359. referencedClasses: []
  360. }),
  361. globals.HLDebugger.klass);
  362. smalltalk.addMethod(
  363. smalltalk.method({
  364. selector: "tabClass",
  365. protocol: 'accessing',
  366. fn: function (){
  367. var self=this;
  368. return "debugger";
  369. },
  370. args: [],
  371. source: "tabClass\x0a\x09^ 'debugger'",
  372. messageSends: [],
  373. referencedClasses: []
  374. }),
  375. globals.HLDebugger.klass);
  376. smalltalk.addMethod(
  377. smalltalk.method({
  378. selector: "tabLabel",
  379. protocol: 'accessing',
  380. fn: function (){
  381. var self=this;
  382. return "Debugger";
  383. },
  384. args: [],
  385. source: "tabLabel\x0a\x09^ 'Debugger'",
  386. messageSends: [],
  387. referencedClasses: []
  388. }),
  389. globals.HLDebugger.klass);
  390. smalltalk.addClass('HLDebuggerCodeModel', globals.HLCodeModel, ['debuggerModel'], 'Helios-Debugger');
  391. smalltalk.addMethod(
  392. smalltalk.method({
  393. selector: "debuggerModel",
  394. protocol: 'accessing',
  395. fn: function (){
  396. var self=this;
  397. var $1;
  398. $1=self["@debuggerModel"];
  399. return $1;
  400. },
  401. args: [],
  402. source: "debuggerModel\x0a\x09^ debuggerModel",
  403. messageSends: [],
  404. referencedClasses: []
  405. }),
  406. globals.HLDebuggerCodeModel);
  407. smalltalk.addMethod(
  408. smalltalk.method({
  409. selector: "debuggerModel:",
  410. protocol: 'accessing',
  411. fn: function (anObject){
  412. var self=this;
  413. self["@debuggerModel"]=anObject;
  414. return self},
  415. args: ["anObject"],
  416. source: "debuggerModel: anObject\x0a\x09debuggerModel := anObject",
  417. messageSends: [],
  418. referencedClasses: []
  419. }),
  420. globals.HLDebuggerCodeModel);
  421. smalltalk.addMethod(
  422. smalltalk.method({
  423. selector: "doIt:",
  424. protocol: 'actions',
  425. fn: function (aString){
  426. var self=this;
  427. return smalltalk.withContext(function($ctx1) {
  428. var $1;
  429. $1=_st(self._debuggerModel())._evaluate_(aString);
  430. return $1;
  431. }, function($ctx1) {$ctx1.fill(self,"doIt:",{aString:aString},globals.HLDebuggerCodeModel)})},
  432. args: ["aString"],
  433. source: "doIt: aString\x0a\x09^ self debuggerModel evaluate: aString",
  434. messageSends: ["evaluate:", "debuggerModel"],
  435. referencedClasses: []
  436. }),
  437. globals.HLDebuggerCodeModel);
  438. smalltalk.addClass('HLDebuggerCodeWidget', globals.HLBrowserCodeWidget, [], 'Helios-Debugger');
  439. smalltalk.addMethod(
  440. smalltalk.method({
  441. selector: "addStopAt:",
  442. protocol: 'actions',
  443. fn: function (anInteger){
  444. var self=this;
  445. return smalltalk.withContext(function($ctx1) {
  446. _st(self["@editor"])._setGutterMarker_gutter_value_(anInteger,"stops",_st(_st("<div class=\x22stop\x22></stop>"._asJQuery())._toArray())._first());
  447. return self}, function($ctx1) {$ctx1.fill(self,"addStopAt:",{anInteger:anInteger},globals.HLDebuggerCodeWidget)})},
  448. args: ["anInteger"],
  449. source: "addStopAt: anInteger\x0a\x09editor\x0a\x09\x09setGutterMarker: anInteger\x0a\x09\x09gutter: 'stops'\x0a\x09\x09value: '<div class=\x22stop\x22></stop>' asJQuery toArray first",
  450. messageSends: ["setGutterMarker:gutter:value:", "first", "toArray", "asJQuery"],
  451. referencedClasses: []
  452. }),
  453. globals.HLDebuggerCodeWidget);
  454. smalltalk.addMethod(
  455. smalltalk.method({
  456. selector: "clearHighlight",
  457. protocol: 'actions',
  458. fn: function (){
  459. var self=this;
  460. return smalltalk.withContext(function($ctx1) {
  461. _st(self._editor())._clearGutter_("stops");
  462. return self}, function($ctx1) {$ctx1.fill(self,"clearHighlight",{},globals.HLDebuggerCodeWidget)})},
  463. args: [],
  464. source: "clearHighlight\x0a\x09self editor clearGutter: 'stops'",
  465. messageSends: ["clearGutter:", "editor"],
  466. referencedClasses: []
  467. }),
  468. globals.HLDebuggerCodeWidget);
  469. smalltalk.addMethod(
  470. smalltalk.method({
  471. selector: "contents:",
  472. protocol: 'accessing',
  473. fn: function (aString){
  474. var self=this;
  475. return smalltalk.withContext(function($ctx1) {
  476. self._clearHighlight();
  477. globals.HLDebuggerCodeWidget.superclass.fn.prototype._contents_.apply(_st(self), [aString]);
  478. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},globals.HLDebuggerCodeWidget)})},
  479. args: ["aString"],
  480. source: "contents: aString\x0a\x09self clearHighlight.\x0a\x09super contents: aString",
  481. messageSends: ["clearHighlight", "contents:"],
  482. referencedClasses: []
  483. }),
  484. globals.HLDebuggerCodeWidget);
  485. smalltalk.addMethod(
  486. smalltalk.method({
  487. selector: "editorOptions",
  488. protocol: 'accessing',
  489. fn: function (){
  490. var self=this;
  491. return smalltalk.withContext(function($ctx1) {
  492. var $2,$3,$1;
  493. $2=globals.HLDebuggerCodeWidget.superclass.fn.prototype._editorOptions.apply(_st(self), []);
  494. _st($2)._at_put_("gutters",["CodeMirror-linenumbers", "stops"]);
  495. $3=_st($2)._yourself();
  496. $1=$3;
  497. return $1;
  498. }, function($ctx1) {$ctx1.fill(self,"editorOptions",{},globals.HLDebuggerCodeWidget)})},
  499. args: [],
  500. source: "editorOptions\x0a\x09^ super editorOptions\x0a\x09\x09at: 'gutters' put: #('CodeMirror-linenumbers' 'stops');\x0a\x09\x09yourself",
  501. messageSends: ["at:put:", "editorOptions", "yourself"],
  502. referencedClasses: []
  503. }),
  504. globals.HLDebuggerCodeWidget);
  505. smalltalk.addMethod(
  506. smalltalk.method({
  507. selector: "highlight",
  508. protocol: 'actions',
  509. fn: function (){
  510. var self=this;
  511. return smalltalk.withContext(function($ctx1) {
  512. self._highlightNode_(_st(self._browserModel())._nextNode());
  513. return self}, function($ctx1) {$ctx1.fill(self,"highlight",{},globals.HLDebuggerCodeWidget)})},
  514. args: [],
  515. source: "highlight\x0a\x09self highlightNode: self browserModel nextNode",
  516. messageSends: ["highlightNode:", "nextNode", "browserModel"],
  517. referencedClasses: []
  518. }),
  519. globals.HLDebuggerCodeWidget);
  520. smalltalk.addMethod(
  521. smalltalk.method({
  522. selector: "highlightNode:",
  523. protocol: 'actions',
  524. fn: function (aNode){
  525. var self=this;
  526. var token;
  527. return smalltalk.withContext(function($ctx1) {
  528. var $4,$3,$2,$1,$5,$10,$9,$8,$7,$13,$12,$11,$6,$18,$17,$16,$15,$14;
  529. if(($receiver = aNode) == nil || $receiver == null){
  530. aNode;
  531. } else {
  532. self._clearHighlight();
  533. $4=_st(aNode)._positionStart();
  534. $ctx1.sendIdx["positionStart"]=1;
  535. $3=_st($4)._x();
  536. $ctx1.sendIdx["x"]=1;
  537. $2=_st($3).__minus((1));
  538. $ctx1.sendIdx["-"]=1;
  539. $1=self._addStopAt_($2);
  540. $1;
  541. $5=self._editor();
  542. $10=_st(aNode)._positionStart();
  543. $ctx1.sendIdx["positionStart"]=2;
  544. $9=_st($10)._x();
  545. $ctx1.sendIdx["x"]=2;
  546. $8=_st($9).__minus((1));
  547. $ctx1.sendIdx["-"]=2;
  548. $7="line".__minus_gt($8);
  549. $ctx1.sendIdx["->"]=1;
  550. $13=_st(_st(aNode)._positionStart())._y();
  551. $ctx1.sendIdx["y"]=1;
  552. $12=_st($13).__minus((1));
  553. $ctx1.sendIdx["-"]=3;
  554. $11="ch".__minus_gt($12);
  555. $ctx1.sendIdx["->"]=2;
  556. $6=globals.HashedCollection._from_([$7,$11]);
  557. $18=_st(aNode)._positionEnd();
  558. $ctx1.sendIdx["positionEnd"]=1;
  559. $17=_st($18)._x();
  560. $16=_st($17).__minus((1));
  561. $15="line".__minus_gt($16);
  562. $ctx1.sendIdx["->"]=3;
  563. $14=globals.HashedCollection._from_([$15,"ch".__minus_gt(_st(_st(aNode)._positionEnd())._y())]);
  564. _st($5)._setSelection_to_($6,$14);
  565. };
  566. return self}, function($ctx1) {$ctx1.fill(self,"highlightNode:",{aNode:aNode,token:token},globals.HLDebuggerCodeWidget)})},
  567. args: ["aNode"],
  568. source: "highlightNode: aNode\x0a\x09| token |\x0a\x09\x0a\x09aNode ifNotNil: [\x0a\x09\x09self\x0a\x09\x09\x09clearHighlight;\x0a\x09\x09\x09addStopAt: aNode positionStart x - 1.\x0a\x0a\x09\x09self editor \x0a\x09\x09\x09setSelection: #{ 'line' -> (aNode positionStart x - 1). 'ch' -> (aNode positionStart y - 1) }\x0a\x09\x09\x09to: #{ 'line' -> (aNode positionEnd x - 1). 'ch' -> (aNode positionEnd y) } ]",
  569. messageSends: ["ifNotNil:", "clearHighlight", "addStopAt:", "-", "x", "positionStart", "setSelection:to:", "editor", "->", "y", "positionEnd"],
  570. referencedClasses: []
  571. }),
  572. globals.HLDebuggerCodeWidget);
  573. smalltalk.addMethod(
  574. smalltalk.method({
  575. selector: "observeBrowserModel",
  576. protocol: 'actions',
  577. fn: function (){
  578. var self=this;
  579. function $HLDebuggerContextSelected(){return globals.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  580. function $HLDebuggerStepped(){return globals.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  581. function $HLDebuggerWhere(){return globals.HLDebuggerWhere||(typeof HLDebuggerWhere=="undefined"?nil:HLDebuggerWhere)}
  582. return smalltalk.withContext(function($ctx1) {
  583. var $2,$1,$4,$3;
  584. globals.HLDebuggerCodeWidget.superclass.fn.prototype._observeBrowserModel.apply(_st(self), []);
  585. $2=self._browserModel();
  586. $ctx1.sendIdx["browserModel"]=1;
  587. $1=_st($2)._announcer();
  588. $ctx1.sendIdx["announcer"]=1;
  589. _st($1)._on_send_to_($HLDebuggerContextSelected(),"onContextSelected",self);
  590. $ctx1.sendIdx["on:send:to:"]=1;
  591. $4=self._browserModel();
  592. $ctx1.sendIdx["browserModel"]=2;
  593. $3=_st($4)._announcer();
  594. $ctx1.sendIdx["announcer"]=2;
  595. _st($3)._on_send_to_($HLDebuggerStepped(),"onContextSelected",self);
  596. $ctx1.sendIdx["on:send:to:"]=2;
  597. _st(_st(self._browserModel())._announcer())._on_send_to_($HLDebuggerWhere(),"onContextSelected",self);
  598. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},globals.HLDebuggerCodeWidget)})},
  599. args: [],
  600. source: "observeBrowserModel\x0a\x09super observeBrowserModel.\x0a\x09\x0a\x09self browserModel announcer \x0a\x09\x09on: HLDebuggerContextSelected\x0a\x09\x09send: #onContextSelected\x0a\x09\x09to: self.\x0a\x09\x0a\x09self browserModel announcer \x0a\x09\x09on: HLDebuggerStepped\x0a\x09\x09send: #onContextSelected\x0a\x09\x09to: self.\x0a\x09\x0a\x09self browserModel announcer \x0a\x09\x09on: HLDebuggerWhere\x0a\x09\x09send: #onContextSelected\x0a\x09\x09to: self",
  601. messageSends: ["observeBrowserModel", "on:send:to:", "announcer", "browserModel"],
  602. referencedClasses: ["HLDebuggerContextSelected", "HLDebuggerStepped", "HLDebuggerWhere"]
  603. }),
  604. globals.HLDebuggerCodeWidget);
  605. smalltalk.addMethod(
  606. smalltalk.method({
  607. selector: "onContextSelected",
  608. protocol: 'reactions',
  609. fn: function (){
  610. var self=this;
  611. return smalltalk.withContext(function($ctx1) {
  612. self._highlight();
  613. return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected",{},globals.HLDebuggerCodeWidget)})},
  614. args: [],
  615. source: "onContextSelected\x0a\x09self highlight",
  616. messageSends: ["highlight"],
  617. referencedClasses: []
  618. }),
  619. globals.HLDebuggerCodeWidget);
  620. smalltalk.addClass('HLDebuggerModel', globals.HLToolModel, ['rootContext', 'currentContext', 'contexts'], 'Helios-Debugger');
  621. globals.HLDebuggerModel.comment="I am a model for debugging Amber code in Helios.\x0a\x0aMy instances hold a reference to an `AIContext` instance, built from a `MethodContext`. The context should be the root of the context stack.";
  622. smalltalk.addMethod(
  623. smalltalk.method({
  624. selector: "contexts",
  625. protocol: 'accessing',
  626. fn: function (){
  627. var self=this;
  628. var $1;
  629. $1=self["@contexts"];
  630. return $1;
  631. },
  632. args: [],
  633. source: "contexts\x0a\x09^ contexts",
  634. messageSends: [],
  635. referencedClasses: []
  636. }),
  637. globals.HLDebuggerModel);
  638. smalltalk.addMethod(
  639. smalltalk.method({
  640. selector: "currentContext",
  641. protocol: 'accessing',
  642. fn: function (){
  643. var self=this;
  644. return smalltalk.withContext(function($ctx1) {
  645. var $1,$2;
  646. $1=self["@currentContext"];
  647. if(($receiver = $1) == nil || $receiver == null){
  648. self._currentContext_(self._rootContext());
  649. } else {
  650. $1;
  651. };
  652. $2=self["@currentContext"];
  653. return $2;
  654. }, function($ctx1) {$ctx1.fill(self,"currentContext",{},globals.HLDebuggerModel)})},
  655. args: [],
  656. source: "currentContext\x0a\x09currentContext ifNil: [ self currentContext: self rootContext ].\x0a\x09^ currentContext",
  657. messageSends: ["ifNil:", "currentContext:", "rootContext"],
  658. referencedClasses: []
  659. }),
  660. globals.HLDebuggerModel);
  661. smalltalk.addMethod(
  662. smalltalk.method({
  663. selector: "currentContext:",
  664. protocol: 'accessing',
  665. fn: function (aContext){
  666. var self=this;
  667. function $HLDebuggerContextSelected(){return globals.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  668. return smalltalk.withContext(function($ctx1) {
  669. var $1,$2;
  670. self._withChangesDo_((function(){
  671. return smalltalk.withContext(function($ctx2) {
  672. self._selectedMethod_(_st(aContext)._method());
  673. self["@currentContext"]=aContext;
  674. self["@currentContext"];
  675. $1=_st($HLDebuggerContextSelected())._new();
  676. _st($1)._context_(aContext);
  677. $2=_st($1)._yourself();
  678. return _st(self._announcer())._announce_($2);
  679. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  680. return self}, function($ctx1) {$ctx1.fill(self,"currentContext:",{aContext:aContext},globals.HLDebuggerModel)})},
  681. args: ["aContext"],
  682. source: "currentContext: aContext\x0a\x09self withChangesDo: [ \x0a\x09\x09self selectedMethod: aContext method.\x0a\x09\x09currentContext := aContext.\x0a\x09\x09self announcer announce: (HLDebuggerContextSelected new\x0a\x09\x09\x09context: aContext;\x0a\x09\x09\x09yourself) ]",
  683. messageSends: ["withChangesDo:", "selectedMethod:", "method", "announce:", "announcer", "context:", "new", "yourself"],
  684. referencedClasses: ["HLDebuggerContextSelected"]
  685. }),
  686. globals.HLDebuggerModel);
  687. smalltalk.addMethod(
  688. smalltalk.method({
  689. selector: "evaluate:",
  690. protocol: 'evaluating',
  691. fn: function (aString){
  692. var self=this;
  693. return smalltalk.withContext(function($ctx1) {
  694. var $1;
  695. $1=_st(self._environment())._interpret_inContext_(aString,self._currentContext());
  696. return $1;
  697. }, function($ctx1) {$ctx1.fill(self,"evaluate:",{aString:aString},globals.HLDebuggerModel)})},
  698. args: ["aString"],
  699. source: "evaluate: aString\x0a\x09^ self environment \x0a\x09\x09interpret: aString \x0a\x09\x09inContext: self currentContext",
  700. messageSends: ["interpret:inContext:", "environment", "currentContext"],
  701. referencedClasses: []
  702. }),
  703. globals.HLDebuggerModel);
  704. smalltalk.addMethod(
  705. smalltalk.method({
  706. selector: "flushInnerContexts",
  707. protocol: 'private',
  708. fn: function (){
  709. var self=this;
  710. return smalltalk.withContext(function($ctx1) {
  711. var $1;
  712. $1=self._currentContext();
  713. $ctx1.sendIdx["currentContext"]=1;
  714. _st($1)._innerContext_(nil);
  715. self["@rootContext"]=self._currentContext();
  716. self._initializeContexts();
  717. return self}, function($ctx1) {$ctx1.fill(self,"flushInnerContexts",{},globals.HLDebuggerModel)})},
  718. args: [],
  719. source: "flushInnerContexts\x0a\x09\x22When stepping, the inner contexts are not relevent anymore,\x0a\x09and can be flushed\x22\x0a\x09\x0a\x09self currentContext innerContext: nil.\x0a\x09rootContext := self currentContext.\x0a\x09self initializeContexts",
  720. messageSends: ["innerContext:", "currentContext", "initializeContexts"],
  721. referencedClasses: []
  722. }),
  723. globals.HLDebuggerModel);
  724. smalltalk.addMethod(
  725. smalltalk.method({
  726. selector: "initializeContexts",
  727. protocol: 'initialization',
  728. fn: function (){
  729. var self=this;
  730. var context;
  731. function $OrderedCollection(){return globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  732. return smalltalk.withContext(function($ctx1) {
  733. self["@contexts"]=_st($OrderedCollection())._new();
  734. context=self._rootContext();
  735. _st((function(){
  736. return smalltalk.withContext(function($ctx2) {
  737. return _st(context)._notNil();
  738. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileTrue_((function(){
  739. return smalltalk.withContext(function($ctx2) {
  740. _st(self["@contexts"])._add_(context);
  741. context=_st(context)._outerContext();
  742. return context;
  743. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  744. return self}, function($ctx1) {$ctx1.fill(self,"initializeContexts",{context:context},globals.HLDebuggerModel)})},
  745. args: [],
  746. 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 ]",
  747. messageSends: ["new", "rootContext", "whileTrue:", "notNil", "add:", "outerContext"],
  748. referencedClasses: ["OrderedCollection"]
  749. }),
  750. globals.HLDebuggerModel);
  751. smalltalk.addMethod(
  752. smalltalk.method({
  753. selector: "initializeFromContext:",
  754. protocol: 'initialization',
  755. fn: function (aMethodContext){
  756. var self=this;
  757. function $AIContext(){return globals.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  758. return smalltalk.withContext(function($ctx1) {
  759. self["@rootContext"]=_st($AIContext())._fromMethodContext_(aMethodContext);
  760. self._initializeContexts();
  761. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromContext:",{aMethodContext:aMethodContext},globals.HLDebuggerModel)})},
  762. args: ["aMethodContext"],
  763. source: "initializeFromContext: aMethodContext\x0a\x09rootContext := (AIContext fromMethodContext: aMethodContext).\x0a\x09self initializeContexts",
  764. messageSends: ["fromMethodContext:", "initializeContexts"],
  765. referencedClasses: ["AIContext"]
  766. }),
  767. globals.HLDebuggerModel);
  768. smalltalk.addMethod(
  769. smalltalk.method({
  770. selector: "interpreter",
  771. protocol: 'accessing',
  772. fn: function (){
  773. var self=this;
  774. return smalltalk.withContext(function($ctx1) {
  775. var $1;
  776. $1=_st(self._currentContext())._interpreter();
  777. return $1;
  778. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},globals.HLDebuggerModel)})},
  779. args: [],
  780. source: "interpreter\x0a\x09^ self currentContext interpreter",
  781. messageSends: ["interpreter", "currentContext"],
  782. referencedClasses: []
  783. }),
  784. globals.HLDebuggerModel);
  785. smalltalk.addMethod(
  786. smalltalk.method({
  787. selector: "nextNode",
  788. protocol: 'accessing',
  789. fn: function (){
  790. var self=this;
  791. return smalltalk.withContext(function($ctx1) {
  792. var $1;
  793. $1=_st(self._interpreter())._node();
  794. return $1;
  795. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},globals.HLDebuggerModel)})},
  796. args: [],
  797. source: "nextNode\x0a\x09^ self interpreter node",
  798. messageSends: ["node", "interpreter"],
  799. referencedClasses: []
  800. }),
  801. globals.HLDebuggerModel);
  802. smalltalk.addMethod(
  803. smalltalk.method({
  804. selector: "restart",
  805. protocol: 'actions',
  806. fn: function (){
  807. var self=this;
  808. function $HLDebuggerStepped(){return globals.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  809. return smalltalk.withContext(function($ctx1) {
  810. var $1,$2;
  811. _st(self._interpreter())._restart();
  812. self._flushInnerContexts();
  813. $1=_st($HLDebuggerStepped())._new();
  814. _st($1)._context_(self._currentContext());
  815. $2=_st($1)._yourself();
  816. _st(self._announcer())._announce_($2);
  817. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},globals.HLDebuggerModel)})},
  818. args: [],
  819. source: "restart\x0a\x09self interpreter restart.\x0a\x09self flushInnerContexts.\x0a\x09\x0a\x09self announcer announce: (HLDebuggerStepped new\x0a\x09\x09context: self currentContext;\x0a\x09\x09yourself)",
  820. messageSends: ["restart", "interpreter", "flushInnerContexts", "announce:", "announcer", "context:", "new", "currentContext", "yourself"],
  821. referencedClasses: ["HLDebuggerStepped"]
  822. }),
  823. globals.HLDebuggerModel);
  824. smalltalk.addMethod(
  825. smalltalk.method({
  826. selector: "rootContext",
  827. protocol: 'accessing',
  828. fn: function (){
  829. var self=this;
  830. var $1;
  831. $1=self["@rootContext"];
  832. return $1;
  833. },
  834. args: [],
  835. source: "rootContext\x0a\x09^ rootContext",
  836. messageSends: [],
  837. referencedClasses: []
  838. }),
  839. globals.HLDebuggerModel);
  840. smalltalk.addMethod(
  841. smalltalk.method({
  842. selector: "skip",
  843. protocol: 'actions',
  844. fn: function (){
  845. var self=this;
  846. function $HLDebuggerStepped(){return globals.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  847. return smalltalk.withContext(function($ctx1) {
  848. var $1,$2;
  849. _st(self._interpreter())._skip();
  850. self._flushInnerContexts();
  851. $1=_st($HLDebuggerStepped())._new();
  852. _st($1)._context_(self._currentContext());
  853. $2=_st($1)._yourself();
  854. _st(self._announcer())._announce_($2);
  855. return self}, function($ctx1) {$ctx1.fill(self,"skip",{},globals.HLDebuggerModel)})},
  856. args: [],
  857. source: "skip\x0a\x09self interpreter skip.\x0a\x09self flushInnerContexts.\x0a\x09\x0a\x09self announcer announce: (HLDebuggerStepped new\x0a\x09\x09context: self currentContext;\x0a\x09\x09yourself)",
  858. messageSends: ["skip", "interpreter", "flushInnerContexts", "announce:", "announcer", "context:", "new", "currentContext", "yourself"],
  859. referencedClasses: ["HLDebuggerStepped"]
  860. }),
  861. globals.HLDebuggerModel);
  862. smalltalk.addMethod(
  863. smalltalk.method({
  864. selector: "stepOver",
  865. protocol: 'actions',
  866. fn: function (){
  867. var self=this;
  868. function $HLDebuggerStepped(){return globals.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  869. return smalltalk.withContext(function($ctx1) {
  870. var $1,$2;
  871. _st(self._interpreter())._stepOver();
  872. self._flushInnerContexts();
  873. $1=_st($HLDebuggerStepped())._new();
  874. _st($1)._context_(self._currentContext());
  875. $2=_st($1)._yourself();
  876. _st(self._announcer())._announce_($2);
  877. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},globals.HLDebuggerModel)})},
  878. args: [],
  879. source: "stepOver\x0a\x09self interpreter stepOver.\x0a\x09self flushInnerContexts.\x0a\x09\x0a\x09self announcer announce: (HLDebuggerStepped new\x0a\x09\x09context: self currentContext;\x0a\x09\x09yourself)",
  880. messageSends: ["stepOver", "interpreter", "flushInnerContexts", "announce:", "announcer", "context:", "new", "currentContext", "yourself"],
  881. referencedClasses: ["HLDebuggerStepped"]
  882. }),
  883. globals.HLDebuggerModel);
  884. smalltalk.addMethod(
  885. smalltalk.method({
  886. selector: "where",
  887. protocol: 'actions',
  888. fn: function (){
  889. var self=this;
  890. function $HLDebuggerWhere(){return globals.HLDebuggerWhere||(typeof HLDebuggerWhere=="undefined"?nil:HLDebuggerWhere)}
  891. return smalltalk.withContext(function($ctx1) {
  892. _st(self._announcer())._announce_(_st($HLDebuggerWhere())._new());
  893. return self}, function($ctx1) {$ctx1.fill(self,"where",{},globals.HLDebuggerModel)})},
  894. args: [],
  895. source: "where\x0a\x09self announcer announce: HLDebuggerWhere new",
  896. messageSends: ["announce:", "announcer", "new"],
  897. referencedClasses: ["HLDebuggerWhere"]
  898. }),
  899. globals.HLDebuggerModel);
  900. smalltalk.addMethod(
  901. smalltalk.method({
  902. selector: "on:",
  903. protocol: 'instance creation',
  904. fn: function (aMethodContext){
  905. var self=this;
  906. return smalltalk.withContext(function($ctx1) {
  907. var $2,$3,$1;
  908. $2=self._new();
  909. _st($2)._initializeFromContext_(aMethodContext);
  910. $3=_st($2)._yourself();
  911. $1=$3;
  912. return $1;
  913. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},globals.HLDebuggerModel.klass)})},
  914. args: ["aMethodContext"],
  915. source: "on: aMethodContext\x0a\x09^ self new\x0a\x09\x09initializeFromContext: aMethodContext;\x0a\x09\x09yourself",
  916. messageSends: ["initializeFromContext:", "new", "yourself"],
  917. referencedClasses: []
  918. }),
  919. globals.HLDebuggerModel.klass);
  920. smalltalk.addClass('HLErrorHandler', globals.Object, [], 'Helios-Debugger');
  921. smalltalk.addMethod(
  922. smalltalk.method({
  923. selector: "handleError:",
  924. protocol: 'error handling',
  925. fn: function (anError){
  926. var self=this;
  927. function $HLDebugger(){return globals.HLDebugger||(typeof HLDebugger=="undefined"?nil:HLDebugger)}
  928. function $Error(){return globals.Error||(typeof Error=="undefined"?nil:Error)}
  929. function $ErrorHandler(){return globals.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  930. return smalltalk.withContext(function($ctx1) {
  931. self._onErrorHandled();
  932. _st((function(){
  933. return smalltalk.withContext(function($ctx2) {
  934. return _st(_st($HLDebugger())._on_(_st(anError)._context()))._openAsTab();
  935. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($Error(),(function(error){
  936. return smalltalk.withContext(function($ctx2) {
  937. return _st(_st($ErrorHandler())._new())._handleError_(error);
  938. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1,2)})}));
  939. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},globals.HLErrorHandler)})},
  940. args: ["anError"],
  941. source: "handleError: anError\x0a\x09self onErrorHandled.\x0a\x0a\x09[ \x0a\x09\x09(HLDebugger on: anError context) openAsTab \x0a\x09] \x0a\x09\x09on: Error \x0a\x09\x09do: [ :error | ErrorHandler new handleError: error ]",
  942. messageSends: ["onErrorHandled", "on:do:", "openAsTab", "on:", "context", "handleError:", "new"],
  943. referencedClasses: ["HLDebugger", "Error", "ErrorHandler"]
  944. }),
  945. globals.HLErrorHandler);
  946. smalltalk.addMethod(
  947. smalltalk.method({
  948. selector: "onErrorHandled",
  949. protocol: 'error handling',
  950. fn: function (){
  951. var self=this;
  952. function $HLProgressWidget(){return globals.HLProgressWidget||(typeof HLProgressWidget=="undefined"?nil:HLProgressWidget)}
  953. return smalltalk.withContext(function($ctx1) {
  954. var $1,$2;
  955. $1=_st($HLProgressWidget())._default();
  956. _st($1)._flush();
  957. $2=_st($1)._remove();
  958. return self}, function($ctx1) {$ctx1.fill(self,"onErrorHandled",{},globals.HLErrorHandler)})},
  959. args: [],
  960. source: "onErrorHandled\x0a\x09\x22when an error is handled, we need to make sure that\x0a\x09any progress bar widget gets removed. Because HLProgressBarWidget is asynchronous,\x0a\x09it has to be done here.\x22\x0a\x09\x0a\x09HLProgressWidget default \x0a\x09\x09flush; \x0a\x09\x09remove",
  961. messageSends: ["flush", "default", "remove"],
  962. referencedClasses: ["HLProgressWidget"]
  963. }),
  964. globals.HLErrorHandler);
  965. smalltalk.addClass('HLStackListWidget', globals.HLToolListWidget, [], 'Helios-Debugger');
  966. smalltalk.addMethod(
  967. smalltalk.method({
  968. selector: "items",
  969. protocol: 'accessing',
  970. fn: function (){
  971. var self=this;
  972. return smalltalk.withContext(function($ctx1) {
  973. var $2,$1;
  974. $2=self["@items"];
  975. if(($receiver = $2) == nil || $receiver == null){
  976. self["@items"]=_st(self._model())._contexts();
  977. $1=self["@items"];
  978. } else {
  979. $1=$2;
  980. };
  981. return $1;
  982. }, function($ctx1) {$ctx1.fill(self,"items",{},globals.HLStackListWidget)})},
  983. args: [],
  984. source: "items\x0a\x09^ items ifNil: [ items := self model contexts ]",
  985. messageSends: ["ifNil:", "contexts", "model"],
  986. referencedClasses: []
  987. }),
  988. globals.HLStackListWidget);
  989. smalltalk.addMethod(
  990. smalltalk.method({
  991. selector: "label",
  992. protocol: 'accessing',
  993. fn: function (){
  994. var self=this;
  995. return "Call stack";
  996. },
  997. args: [],
  998. source: "label\x0a\x09^ 'Call stack'",
  999. messageSends: [],
  1000. referencedClasses: []
  1001. }),
  1002. globals.HLStackListWidget);
  1003. smalltalk.addMethod(
  1004. smalltalk.method({
  1005. selector: "observeModel",
  1006. protocol: 'actions',
  1007. fn: function (){
  1008. var self=this;
  1009. function $HLDebuggerStepped(){return globals.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  1010. return smalltalk.withContext(function($ctx1) {
  1011. globals.HLStackListWidget.superclass.fn.prototype._observeModel.apply(_st(self), []);
  1012. _st(_st(self._model())._announcer())._on_send_to_($HLDebuggerStepped(),"onDebuggerStepped:",self);
  1013. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},globals.HLStackListWidget)})},
  1014. args: [],
  1015. source: "observeModel\x0a\x09super observeModel.\x0a\x09\x0a\x09self model announcer \x0a\x09\x09on: HLDebuggerStepped\x0a\x09\x09send: #onDebuggerStepped:\x0a\x09\x09to: self",
  1016. messageSends: ["observeModel", "on:send:to:", "announcer", "model"],
  1017. referencedClasses: ["HLDebuggerStepped"]
  1018. }),
  1019. globals.HLStackListWidget);
  1020. smalltalk.addMethod(
  1021. smalltalk.method({
  1022. selector: "onDebuggerStepped:",
  1023. protocol: 'reactions',
  1024. fn: function (anAnnouncement){
  1025. var self=this;
  1026. return smalltalk.withContext(function($ctx1) {
  1027. self["@items"]=nil;
  1028. self._refresh();
  1029. return self}, function($ctx1) {$ctx1.fill(self,"onDebuggerStepped:",{anAnnouncement:anAnnouncement},globals.HLStackListWidget)})},
  1030. args: ["anAnnouncement"],
  1031. source: "onDebuggerStepped: anAnnouncement\x0a\x09items := nil.\x0a\x09self refresh",
  1032. messageSends: ["refresh"],
  1033. referencedClasses: []
  1034. }),
  1035. globals.HLStackListWidget);
  1036. smalltalk.addMethod(
  1037. smalltalk.method({
  1038. selector: "renderButtonsOn:",
  1039. protocol: 'rendering',
  1040. fn: function (html){
  1041. var self=this;
  1042. return smalltalk.withContext(function($ctx1) {
  1043. var $1,$3,$4,$5,$6,$7,$8,$9,$10,$2;
  1044. $1=_st(html)._div();
  1045. _st($1)._class_("debugger_bar");
  1046. $ctx1.sendIdx["class:"]=1;
  1047. $2=_st($1)._with_((function(){
  1048. return smalltalk.withContext(function($ctx2) {
  1049. $3=_st(html)._button();
  1050. $ctx2.sendIdx["button"]=1;
  1051. _st($3)._class_("btn restart");
  1052. $ctx2.sendIdx["class:"]=2;
  1053. _st($3)._with_("Restart");
  1054. $ctx2.sendIdx["with:"]=2;
  1055. $4=_st($3)._onClick_((function(){
  1056. return smalltalk.withContext(function($ctx3) {
  1057. return self._restart();
  1058. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  1059. $ctx2.sendIdx["onClick:"]=1;
  1060. $4;
  1061. $5=_st(html)._button();
  1062. $ctx2.sendIdx["button"]=2;
  1063. _st($5)._class_("btn where");
  1064. $ctx2.sendIdx["class:"]=3;
  1065. _st($5)._with_("Where");
  1066. $ctx2.sendIdx["with:"]=3;
  1067. $6=_st($5)._onClick_((function(){
  1068. return smalltalk.withContext(function($ctx3) {
  1069. return self._where();
  1070. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  1071. $ctx2.sendIdx["onClick:"]=2;
  1072. $6;
  1073. $7=_st(html)._button();
  1074. $ctx2.sendIdx["button"]=3;
  1075. _st($7)._class_("btn stepOver");
  1076. $ctx2.sendIdx["class:"]=4;
  1077. _st($7)._with_("Step over");
  1078. $ctx2.sendIdx["with:"]=4;
  1079. $8=_st($7)._onClick_((function(){
  1080. return smalltalk.withContext(function($ctx3) {
  1081. return self._stepOver();
  1082. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
  1083. $ctx2.sendIdx["onClick:"]=3;
  1084. $8;
  1085. $9=_st(html)._button();
  1086. _st($9)._class_("btn skip");
  1087. _st($9)._with_("Skip");
  1088. $10=_st($9)._onClick_((function(){
  1089. return smalltalk.withContext(function($ctx3) {
  1090. return self._skip();
  1091. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,5)})}));
  1092. return $10;
  1093. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1094. $ctx1.sendIdx["with:"]=1;
  1095. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},globals.HLStackListWidget)})},
  1096. args: ["html"],
  1097. source: "renderButtonsOn: html\x0a\x09html div \x0a\x09\x09class: 'debugger_bar'; \x0a\x09\x09with: [\x0a\x09\x09\x09html button \x0a\x09\x09\x09\x09class: 'btn restart';\x0a\x09\x09\x09\x09with: 'Restart';\x0a\x09\x09\x09\x09onClick: [ self restart ].\x0a\x09\x09\x09html button \x0a\x09\x09\x09\x09class: 'btn where';\x0a\x09\x09\x09\x09with: 'Where';\x0a\x09\x09\x09\x09onClick: [ self where ].\x0a\x09\x09\x09html button \x0a\x09\x09\x09\x09class: 'btn stepOver';\x0a\x09\x09\x09\x09with: 'Step over';\x0a\x09\x09\x09\x09onClick: [ self stepOver ].\x0a\x09\x09\x09html button \x0a\x09\x09\x09\x09class: 'btn skip';\x0a\x09\x09\x09\x09with: 'Skip';\x0a\x09\x09\x09\x09onClick: [ self skip ] ]",
  1098. messageSends: ["class:", "div", "with:", "button", "onClick:", "restart", "where", "stepOver", "skip"],
  1099. referencedClasses: []
  1100. }),
  1101. globals.HLStackListWidget);
  1102. smalltalk.addMethod(
  1103. smalltalk.method({
  1104. selector: "restart",
  1105. protocol: 'actions',
  1106. fn: function (){
  1107. var self=this;
  1108. return smalltalk.withContext(function($ctx1) {
  1109. _st(self._model())._restart();
  1110. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},globals.HLStackListWidget)})},
  1111. args: [],
  1112. source: "restart\x0a\x09self model restart",
  1113. messageSends: ["restart", "model"],
  1114. referencedClasses: []
  1115. }),
  1116. globals.HLStackListWidget);
  1117. smalltalk.addMethod(
  1118. smalltalk.method({
  1119. selector: "selectItem:",
  1120. protocol: 'actions',
  1121. fn: function (aContext){
  1122. var self=this;
  1123. return smalltalk.withContext(function($ctx1) {
  1124. _st(self._model())._currentContext_(aContext);
  1125. globals.HLStackListWidget.superclass.fn.prototype._selectItem_.apply(_st(self), [aContext]);
  1126. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{aContext:aContext},globals.HLStackListWidget)})},
  1127. args: ["aContext"],
  1128. source: "selectItem: aContext\x0a \x09self model currentContext: aContext.\x0a\x09super selectItem: aContext",
  1129. messageSends: ["currentContext:", "model", "selectItem:"],
  1130. referencedClasses: []
  1131. }),
  1132. globals.HLStackListWidget);
  1133. smalltalk.addMethod(
  1134. smalltalk.method({
  1135. selector: "skip",
  1136. protocol: 'actions',
  1137. fn: function (){
  1138. var self=this;
  1139. return smalltalk.withContext(function($ctx1) {
  1140. _st(self._model())._skip();
  1141. return self}, function($ctx1) {$ctx1.fill(self,"skip",{},globals.HLStackListWidget)})},
  1142. args: [],
  1143. source: "skip\x0a\x09self model skip",
  1144. messageSends: ["skip", "model"],
  1145. referencedClasses: []
  1146. }),
  1147. globals.HLStackListWidget);
  1148. smalltalk.addMethod(
  1149. smalltalk.method({
  1150. selector: "stepOver",
  1151. protocol: 'actions',
  1152. fn: function (){
  1153. var self=this;
  1154. return smalltalk.withContext(function($ctx1) {
  1155. _st(self._model())._stepOver();
  1156. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},globals.HLStackListWidget)})},
  1157. args: [],
  1158. source: "stepOver\x0a\x09self model stepOver",
  1159. messageSends: ["stepOver", "model"],
  1160. referencedClasses: []
  1161. }),
  1162. globals.HLStackListWidget);
  1163. smalltalk.addMethod(
  1164. smalltalk.method({
  1165. selector: "where",
  1166. protocol: 'actions',
  1167. fn: function (){
  1168. var self=this;
  1169. return smalltalk.withContext(function($ctx1) {
  1170. _st(self._model())._where();
  1171. return self}, function($ctx1) {$ctx1.fill(self,"where",{},globals.HLStackListWidget)})},
  1172. args: [],
  1173. source: "where\x0a\x09self model where",
  1174. messageSends: ["where", "model"],
  1175. referencedClasses: []
  1176. }),
  1177. globals.HLStackListWidget);
  1178. });