Helios-Debugger.js 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242
  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,$9,$8,$7,$11,$10,$6,$15,$14,$13,$12;
  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. $9=_st(aNode)._positionStart();
  543. $ctx1.sendIdx["positionStart"]=2;
  544. $8=_st($9)._x();
  545. $ctx1.sendIdx["x"]=2;
  546. $7=_st($8).__minus((1));
  547. $ctx1.sendIdx["-"]=2;
  548. $11=_st(_st(aNode)._positionStart())._y();
  549. $ctx1.sendIdx["y"]=1;
  550. $10=_st($11).__minus((1));
  551. $ctx1.sendIdx["-"]=3;
  552. $6=globals.HashedCollection._newFromPairs_(["line",$7,"ch",$10]);
  553. $15=_st(aNode)._positionEnd();
  554. $ctx1.sendIdx["positionEnd"]=1;
  555. $14=_st($15)._x();
  556. $13=_st($14).__minus((1));
  557. $12=globals.HashedCollection._newFromPairs_(["line",$13,"ch",_st(_st(aNode)._positionEnd())._y()]);
  558. _st($5)._setSelection_to_($6,$12);
  559. };
  560. return self}, function($ctx1) {$ctx1.fill(self,"highlightNode:",{aNode:aNode,token:token},globals.HLDebuggerCodeWidget)})},
  561. args: ["aNode"],
  562. 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) } ]",
  563. messageSends: ["ifNotNil:", "clearHighlight", "addStopAt:", "-", "x", "positionStart", "setSelection:to:", "editor", "y", "positionEnd"],
  564. referencedClasses: []
  565. }),
  566. globals.HLDebuggerCodeWidget);
  567. smalltalk.addMethod(
  568. smalltalk.method({
  569. selector: "observeBrowserModel",
  570. protocol: 'actions',
  571. fn: function (){
  572. var self=this;
  573. function $HLDebuggerContextSelected(){return globals.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  574. function $HLDebuggerStepped(){return globals.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  575. function $HLDebuggerWhere(){return globals.HLDebuggerWhere||(typeof HLDebuggerWhere=="undefined"?nil:HLDebuggerWhere)}
  576. return smalltalk.withContext(function($ctx1) {
  577. var $2,$1,$4,$3;
  578. globals.HLDebuggerCodeWidget.superclass.fn.prototype._observeBrowserModel.apply(_st(self), []);
  579. $2=self._browserModel();
  580. $ctx1.sendIdx["browserModel"]=1;
  581. $1=_st($2)._announcer();
  582. $ctx1.sendIdx["announcer"]=1;
  583. _st($1)._on_send_to_($HLDebuggerContextSelected(),"onContextSelected",self);
  584. $ctx1.sendIdx["on:send:to:"]=1;
  585. $4=self._browserModel();
  586. $ctx1.sendIdx["browserModel"]=2;
  587. $3=_st($4)._announcer();
  588. $ctx1.sendIdx["announcer"]=2;
  589. _st($3)._on_send_to_($HLDebuggerStepped(),"onContextSelected",self);
  590. $ctx1.sendIdx["on:send:to:"]=2;
  591. _st(_st(self._browserModel())._announcer())._on_send_to_($HLDebuggerWhere(),"onContextSelected",self);
  592. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},globals.HLDebuggerCodeWidget)})},
  593. args: [],
  594. 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",
  595. messageSends: ["observeBrowserModel", "on:send:to:", "announcer", "browserModel"],
  596. referencedClasses: ["HLDebuggerContextSelected", "HLDebuggerStepped", "HLDebuggerWhere"]
  597. }),
  598. globals.HLDebuggerCodeWidget);
  599. smalltalk.addMethod(
  600. smalltalk.method({
  601. selector: "onContextSelected",
  602. protocol: 'reactions',
  603. fn: function (){
  604. var self=this;
  605. return smalltalk.withContext(function($ctx1) {
  606. self._highlight();
  607. return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected",{},globals.HLDebuggerCodeWidget)})},
  608. args: [],
  609. source: "onContextSelected\x0a\x09self highlight",
  610. messageSends: ["highlight"],
  611. referencedClasses: []
  612. }),
  613. globals.HLDebuggerCodeWidget);
  614. smalltalk.addClass('HLDebuggerModel', globals.HLToolModel, ['rootContext', 'currentContext', 'contexts'], 'Helios-Debugger');
  615. 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.";
  616. smalltalk.addMethod(
  617. smalltalk.method({
  618. selector: "contexts",
  619. protocol: 'accessing',
  620. fn: function (){
  621. var self=this;
  622. var $1;
  623. $1=self["@contexts"];
  624. return $1;
  625. },
  626. args: [],
  627. source: "contexts\x0a\x09^ contexts",
  628. messageSends: [],
  629. referencedClasses: []
  630. }),
  631. globals.HLDebuggerModel);
  632. smalltalk.addMethod(
  633. smalltalk.method({
  634. selector: "currentContext",
  635. protocol: 'accessing',
  636. fn: function (){
  637. var self=this;
  638. return smalltalk.withContext(function($ctx1) {
  639. var $1,$2;
  640. $1=self["@currentContext"];
  641. if(($receiver = $1) == nil || $receiver == null){
  642. self._currentContext_(self._rootContext());
  643. } else {
  644. $1;
  645. };
  646. $2=self["@currentContext"];
  647. return $2;
  648. }, function($ctx1) {$ctx1.fill(self,"currentContext",{},globals.HLDebuggerModel)})},
  649. args: [],
  650. source: "currentContext\x0a\x09currentContext ifNil: [ self currentContext: self rootContext ].\x0a\x09^ currentContext",
  651. messageSends: ["ifNil:", "currentContext:", "rootContext"],
  652. referencedClasses: []
  653. }),
  654. globals.HLDebuggerModel);
  655. smalltalk.addMethod(
  656. smalltalk.method({
  657. selector: "currentContext:",
  658. protocol: 'accessing',
  659. fn: function (aContext){
  660. var self=this;
  661. function $HLDebuggerContextSelected(){return globals.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  662. return smalltalk.withContext(function($ctx1) {
  663. var $1,$2;
  664. self._withChangesDo_((function(){
  665. return smalltalk.withContext(function($ctx2) {
  666. self._selectedMethod_(_st(aContext)._method());
  667. self["@currentContext"]=aContext;
  668. self["@currentContext"];
  669. $1=_st($HLDebuggerContextSelected())._new();
  670. _st($1)._context_(aContext);
  671. $2=_st($1)._yourself();
  672. return _st(self._announcer())._announce_($2);
  673. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  674. return self}, function($ctx1) {$ctx1.fill(self,"currentContext:",{aContext:aContext},globals.HLDebuggerModel)})},
  675. args: ["aContext"],
  676. 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) ]",
  677. messageSends: ["withChangesDo:", "selectedMethod:", "method", "announce:", "announcer", "context:", "new", "yourself"],
  678. referencedClasses: ["HLDebuggerContextSelected"]
  679. }),
  680. globals.HLDebuggerModel);
  681. smalltalk.addMethod(
  682. smalltalk.method({
  683. selector: "evaluate:",
  684. protocol: 'evaluating',
  685. fn: function (aString){
  686. var self=this;
  687. return smalltalk.withContext(function($ctx1) {
  688. var $1;
  689. $1=_st(self._environment())._interpret_inContext_(aString,self._currentContext());
  690. return $1;
  691. }, function($ctx1) {$ctx1.fill(self,"evaluate:",{aString:aString},globals.HLDebuggerModel)})},
  692. args: ["aString"],
  693. source: "evaluate: aString\x0a\x09^ self environment \x0a\x09\x09interpret: aString \x0a\x09\x09inContext: self currentContext",
  694. messageSends: ["interpret:inContext:", "environment", "currentContext"],
  695. referencedClasses: []
  696. }),
  697. globals.HLDebuggerModel);
  698. smalltalk.addMethod(
  699. smalltalk.method({
  700. selector: "flushInnerContexts",
  701. protocol: 'private',
  702. fn: function (){
  703. var self=this;
  704. return smalltalk.withContext(function($ctx1) {
  705. var $1;
  706. $1=self._currentContext();
  707. $ctx1.sendIdx["currentContext"]=1;
  708. _st($1)._innerContext_(nil);
  709. self["@rootContext"]=self._currentContext();
  710. self._initializeContexts();
  711. return self}, function($ctx1) {$ctx1.fill(self,"flushInnerContexts",{},globals.HLDebuggerModel)})},
  712. args: [],
  713. 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",
  714. messageSends: ["innerContext:", "currentContext", "initializeContexts"],
  715. referencedClasses: []
  716. }),
  717. globals.HLDebuggerModel);
  718. smalltalk.addMethod(
  719. smalltalk.method({
  720. selector: "initializeContexts",
  721. protocol: 'initialization',
  722. fn: function (){
  723. var self=this;
  724. var context;
  725. function $OrderedCollection(){return globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  726. return smalltalk.withContext(function($ctx1) {
  727. self["@contexts"]=_st($OrderedCollection())._new();
  728. context=self._rootContext();
  729. _st((function(){
  730. return smalltalk.withContext(function($ctx2) {
  731. return _st(context)._notNil();
  732. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileTrue_((function(){
  733. return smalltalk.withContext(function($ctx2) {
  734. _st(self["@contexts"])._add_(context);
  735. context=_st(context)._outerContext();
  736. return context;
  737. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  738. return self}, function($ctx1) {$ctx1.fill(self,"initializeContexts",{context:context},globals.HLDebuggerModel)})},
  739. args: [],
  740. 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 ]",
  741. messageSends: ["new", "rootContext", "whileTrue:", "notNil", "add:", "outerContext"],
  742. referencedClasses: ["OrderedCollection"]
  743. }),
  744. globals.HLDebuggerModel);
  745. smalltalk.addMethod(
  746. smalltalk.method({
  747. selector: "initializeFromContext:",
  748. protocol: 'initialization',
  749. fn: function (aMethodContext){
  750. var self=this;
  751. function $AIContext(){return globals.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  752. return smalltalk.withContext(function($ctx1) {
  753. self["@rootContext"]=_st($AIContext())._fromMethodContext_(aMethodContext);
  754. self._initializeContexts();
  755. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromContext:",{aMethodContext:aMethodContext},globals.HLDebuggerModel)})},
  756. args: ["aMethodContext"],
  757. source: "initializeFromContext: aMethodContext\x0a\x09rootContext := (AIContext fromMethodContext: aMethodContext).\x0a\x09self initializeContexts",
  758. messageSends: ["fromMethodContext:", "initializeContexts"],
  759. referencedClasses: ["AIContext"]
  760. }),
  761. globals.HLDebuggerModel);
  762. smalltalk.addMethod(
  763. smalltalk.method({
  764. selector: "interpreter",
  765. protocol: 'accessing',
  766. fn: function (){
  767. var self=this;
  768. return smalltalk.withContext(function($ctx1) {
  769. var $1;
  770. $1=_st(self._currentContext())._interpreter();
  771. return $1;
  772. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},globals.HLDebuggerModel)})},
  773. args: [],
  774. source: "interpreter\x0a\x09^ self currentContext interpreter",
  775. messageSends: ["interpreter", "currentContext"],
  776. referencedClasses: []
  777. }),
  778. globals.HLDebuggerModel);
  779. smalltalk.addMethod(
  780. smalltalk.method({
  781. selector: "nextNode",
  782. protocol: 'accessing',
  783. fn: function (){
  784. var self=this;
  785. return smalltalk.withContext(function($ctx1) {
  786. var $1;
  787. $1=_st(self._interpreter())._node();
  788. return $1;
  789. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},globals.HLDebuggerModel)})},
  790. args: [],
  791. source: "nextNode\x0a\x09^ self interpreter node",
  792. messageSends: ["node", "interpreter"],
  793. referencedClasses: []
  794. }),
  795. globals.HLDebuggerModel);
  796. smalltalk.addMethod(
  797. smalltalk.method({
  798. selector: "restart",
  799. protocol: 'actions',
  800. fn: function (){
  801. var self=this;
  802. function $HLDebuggerStepped(){return globals.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  803. return smalltalk.withContext(function($ctx1) {
  804. var $1,$2;
  805. _st(self._interpreter())._restart();
  806. self._flushInnerContexts();
  807. $1=_st($HLDebuggerStepped())._new();
  808. _st($1)._context_(self._currentContext());
  809. $2=_st($1)._yourself();
  810. _st(self._announcer())._announce_($2);
  811. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},globals.HLDebuggerModel)})},
  812. args: [],
  813. 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)",
  814. messageSends: ["restart", "interpreter", "flushInnerContexts", "announce:", "announcer", "context:", "new", "currentContext", "yourself"],
  815. referencedClasses: ["HLDebuggerStepped"]
  816. }),
  817. globals.HLDebuggerModel);
  818. smalltalk.addMethod(
  819. smalltalk.method({
  820. selector: "rootContext",
  821. protocol: 'accessing',
  822. fn: function (){
  823. var self=this;
  824. var $1;
  825. $1=self["@rootContext"];
  826. return $1;
  827. },
  828. args: [],
  829. source: "rootContext\x0a\x09^ rootContext",
  830. messageSends: [],
  831. referencedClasses: []
  832. }),
  833. globals.HLDebuggerModel);
  834. smalltalk.addMethod(
  835. smalltalk.method({
  836. selector: "skip",
  837. protocol: 'actions',
  838. fn: function (){
  839. var self=this;
  840. function $HLDebuggerStepped(){return globals.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  841. return smalltalk.withContext(function($ctx1) {
  842. var $1,$2;
  843. _st(self._interpreter())._skip();
  844. self._flushInnerContexts();
  845. $1=_st($HLDebuggerStepped())._new();
  846. _st($1)._context_(self._currentContext());
  847. $2=_st($1)._yourself();
  848. _st(self._announcer())._announce_($2);
  849. return self}, function($ctx1) {$ctx1.fill(self,"skip",{},globals.HLDebuggerModel)})},
  850. args: [],
  851. 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)",
  852. messageSends: ["skip", "interpreter", "flushInnerContexts", "announce:", "announcer", "context:", "new", "currentContext", "yourself"],
  853. referencedClasses: ["HLDebuggerStepped"]
  854. }),
  855. globals.HLDebuggerModel);
  856. smalltalk.addMethod(
  857. smalltalk.method({
  858. selector: "stepOver",
  859. protocol: 'actions',
  860. fn: function (){
  861. var self=this;
  862. function $HLDebuggerStepped(){return globals.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  863. return smalltalk.withContext(function($ctx1) {
  864. var $1,$2;
  865. _st(self._interpreter())._stepOver();
  866. self._flushInnerContexts();
  867. $1=_st($HLDebuggerStepped())._new();
  868. _st($1)._context_(self._currentContext());
  869. $2=_st($1)._yourself();
  870. _st(self._announcer())._announce_($2);
  871. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},globals.HLDebuggerModel)})},
  872. args: [],
  873. 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)",
  874. messageSends: ["stepOver", "interpreter", "flushInnerContexts", "announce:", "announcer", "context:", "new", "currentContext", "yourself"],
  875. referencedClasses: ["HLDebuggerStepped"]
  876. }),
  877. globals.HLDebuggerModel);
  878. smalltalk.addMethod(
  879. smalltalk.method({
  880. selector: "where",
  881. protocol: 'actions',
  882. fn: function (){
  883. var self=this;
  884. function $HLDebuggerWhere(){return globals.HLDebuggerWhere||(typeof HLDebuggerWhere=="undefined"?nil:HLDebuggerWhere)}
  885. return smalltalk.withContext(function($ctx1) {
  886. _st(self._announcer())._announce_(_st($HLDebuggerWhere())._new());
  887. return self}, function($ctx1) {$ctx1.fill(self,"where",{},globals.HLDebuggerModel)})},
  888. args: [],
  889. source: "where\x0a\x09self announcer announce: HLDebuggerWhere new",
  890. messageSends: ["announce:", "announcer", "new"],
  891. referencedClasses: ["HLDebuggerWhere"]
  892. }),
  893. globals.HLDebuggerModel);
  894. smalltalk.addMethod(
  895. smalltalk.method({
  896. selector: "on:",
  897. protocol: 'instance creation',
  898. fn: function (aMethodContext){
  899. var self=this;
  900. return smalltalk.withContext(function($ctx1) {
  901. var $2,$3,$1;
  902. $2=self._new();
  903. _st($2)._initializeFromContext_(aMethodContext);
  904. $3=_st($2)._yourself();
  905. $1=$3;
  906. return $1;
  907. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},globals.HLDebuggerModel.klass)})},
  908. args: ["aMethodContext"],
  909. source: "on: aMethodContext\x0a\x09^ self new\x0a\x09\x09initializeFromContext: aMethodContext;\x0a\x09\x09yourself",
  910. messageSends: ["initializeFromContext:", "new", "yourself"],
  911. referencedClasses: []
  912. }),
  913. globals.HLDebuggerModel.klass);
  914. smalltalk.addClass('HLErrorHandler', globals.Object, [], 'Helios-Debugger');
  915. smalltalk.addMethod(
  916. smalltalk.method({
  917. selector: "handleError:",
  918. protocol: 'error handling',
  919. fn: function (anError){
  920. var self=this;
  921. function $HLDebugger(){return globals.HLDebugger||(typeof HLDebugger=="undefined"?nil:HLDebugger)}
  922. function $Error(){return globals.Error||(typeof Error=="undefined"?nil:Error)}
  923. function $ErrorHandler(){return globals.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  924. return smalltalk.withContext(function($ctx1) {
  925. self._onErrorHandled();
  926. _st((function(){
  927. return smalltalk.withContext(function($ctx2) {
  928. return _st(_st($HLDebugger())._on_(_st(anError)._context()))._openAsTab();
  929. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($Error(),(function(error){
  930. return smalltalk.withContext(function($ctx2) {
  931. return _st(_st($ErrorHandler())._new())._handleError_(error);
  932. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1,2)})}));
  933. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},globals.HLErrorHandler)})},
  934. args: ["anError"],
  935. 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 ]",
  936. messageSends: ["onErrorHandled", "on:do:", "openAsTab", "on:", "context", "handleError:", "new"],
  937. referencedClasses: ["HLDebugger", "Error", "ErrorHandler"]
  938. }),
  939. globals.HLErrorHandler);
  940. smalltalk.addMethod(
  941. smalltalk.method({
  942. selector: "onErrorHandled",
  943. protocol: 'error handling',
  944. fn: function (){
  945. var self=this;
  946. function $HLProgressWidget(){return globals.HLProgressWidget||(typeof HLProgressWidget=="undefined"?nil:HLProgressWidget)}
  947. return smalltalk.withContext(function($ctx1) {
  948. var $1,$2;
  949. $1=_st($HLProgressWidget())._default();
  950. _st($1)._flush();
  951. $2=_st($1)._remove();
  952. return self}, function($ctx1) {$ctx1.fill(self,"onErrorHandled",{},globals.HLErrorHandler)})},
  953. args: [],
  954. 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",
  955. messageSends: ["flush", "default", "remove"],
  956. referencedClasses: ["HLProgressWidget"]
  957. }),
  958. globals.HLErrorHandler);
  959. smalltalk.addClass('HLStackListWidget', globals.HLToolListWidget, [], 'Helios-Debugger');
  960. smalltalk.addMethod(
  961. smalltalk.method({
  962. selector: "items",
  963. protocol: 'accessing',
  964. fn: function (){
  965. var self=this;
  966. return smalltalk.withContext(function($ctx1) {
  967. var $2,$1;
  968. $2=self["@items"];
  969. if(($receiver = $2) == nil || $receiver == null){
  970. self["@items"]=_st(self._model())._contexts();
  971. $1=self["@items"];
  972. } else {
  973. $1=$2;
  974. };
  975. return $1;
  976. }, function($ctx1) {$ctx1.fill(self,"items",{},globals.HLStackListWidget)})},
  977. args: [],
  978. source: "items\x0a\x09^ items ifNil: [ items := self model contexts ]",
  979. messageSends: ["ifNil:", "contexts", "model"],
  980. referencedClasses: []
  981. }),
  982. globals.HLStackListWidget);
  983. smalltalk.addMethod(
  984. smalltalk.method({
  985. selector: "label",
  986. protocol: 'accessing',
  987. fn: function (){
  988. var self=this;
  989. return "Call stack";
  990. },
  991. args: [],
  992. source: "label\x0a\x09^ 'Call stack'",
  993. messageSends: [],
  994. referencedClasses: []
  995. }),
  996. globals.HLStackListWidget);
  997. smalltalk.addMethod(
  998. smalltalk.method({
  999. selector: "observeModel",
  1000. protocol: 'actions',
  1001. fn: function (){
  1002. var self=this;
  1003. function $HLDebuggerStepped(){return globals.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  1004. return smalltalk.withContext(function($ctx1) {
  1005. globals.HLStackListWidget.superclass.fn.prototype._observeModel.apply(_st(self), []);
  1006. _st(_st(self._model())._announcer())._on_send_to_($HLDebuggerStepped(),"onDebuggerStepped:",self);
  1007. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},globals.HLStackListWidget)})},
  1008. args: [],
  1009. source: "observeModel\x0a\x09super observeModel.\x0a\x09\x0a\x09self model announcer \x0a\x09\x09on: HLDebuggerStepped\x0a\x09\x09send: #onDebuggerStepped:\x0a\x09\x09to: self",
  1010. messageSends: ["observeModel", "on:send:to:", "announcer", "model"],
  1011. referencedClasses: ["HLDebuggerStepped"]
  1012. }),
  1013. globals.HLStackListWidget);
  1014. smalltalk.addMethod(
  1015. smalltalk.method({
  1016. selector: "onDebuggerStepped:",
  1017. protocol: 'reactions',
  1018. fn: function (anAnnouncement){
  1019. var self=this;
  1020. return smalltalk.withContext(function($ctx1) {
  1021. self["@items"]=nil;
  1022. self._refresh();
  1023. return self}, function($ctx1) {$ctx1.fill(self,"onDebuggerStepped:",{anAnnouncement:anAnnouncement},globals.HLStackListWidget)})},
  1024. args: ["anAnnouncement"],
  1025. source: "onDebuggerStepped: anAnnouncement\x0a\x09items := nil.\x0a\x09self refresh",
  1026. messageSends: ["refresh"],
  1027. referencedClasses: []
  1028. }),
  1029. globals.HLStackListWidget);
  1030. smalltalk.addMethod(
  1031. smalltalk.method({
  1032. selector: "renderButtonsOn:",
  1033. protocol: 'rendering',
  1034. fn: function (html){
  1035. var self=this;
  1036. return smalltalk.withContext(function($ctx1) {
  1037. var $1,$3,$4,$5,$6,$7,$8,$9,$10,$2;
  1038. $1=_st(html)._div();
  1039. _st($1)._class_("debugger_bar");
  1040. $ctx1.sendIdx["class:"]=1;
  1041. $2=_st($1)._with_((function(){
  1042. return smalltalk.withContext(function($ctx2) {
  1043. $3=_st(html)._button();
  1044. $ctx2.sendIdx["button"]=1;
  1045. _st($3)._class_("btn restart");
  1046. $ctx2.sendIdx["class:"]=2;
  1047. _st($3)._with_("Restart");
  1048. $ctx2.sendIdx["with:"]=2;
  1049. $4=_st($3)._onClick_((function(){
  1050. return smalltalk.withContext(function($ctx3) {
  1051. return self._restart();
  1052. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  1053. $ctx2.sendIdx["onClick:"]=1;
  1054. $4;
  1055. $5=_st(html)._button();
  1056. $ctx2.sendIdx["button"]=2;
  1057. _st($5)._class_("btn where");
  1058. $ctx2.sendIdx["class:"]=3;
  1059. _st($5)._with_("Where");
  1060. $ctx2.sendIdx["with:"]=3;
  1061. $6=_st($5)._onClick_((function(){
  1062. return smalltalk.withContext(function($ctx3) {
  1063. return self._where();
  1064. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  1065. $ctx2.sendIdx["onClick:"]=2;
  1066. $6;
  1067. $7=_st(html)._button();
  1068. $ctx2.sendIdx["button"]=3;
  1069. _st($7)._class_("btn stepOver");
  1070. $ctx2.sendIdx["class:"]=4;
  1071. _st($7)._with_("Step over");
  1072. $ctx2.sendIdx["with:"]=4;
  1073. $8=_st($7)._onClick_((function(){
  1074. return smalltalk.withContext(function($ctx3) {
  1075. return self._stepOver();
  1076. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
  1077. $ctx2.sendIdx["onClick:"]=3;
  1078. $8;
  1079. $9=_st(html)._button();
  1080. _st($9)._class_("btn skip");
  1081. _st($9)._with_("Skip");
  1082. $10=_st($9)._onClick_((function(){
  1083. return smalltalk.withContext(function($ctx3) {
  1084. return self._skip();
  1085. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,5)})}));
  1086. return $10;
  1087. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1088. $ctx1.sendIdx["with:"]=1;
  1089. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},globals.HLStackListWidget)})},
  1090. args: ["html"],
  1091. 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 ] ]",
  1092. messageSends: ["class:", "div", "with:", "button", "onClick:", "restart", "where", "stepOver", "skip"],
  1093. referencedClasses: []
  1094. }),
  1095. globals.HLStackListWidget);
  1096. smalltalk.addMethod(
  1097. smalltalk.method({
  1098. selector: "restart",
  1099. protocol: 'actions',
  1100. fn: function (){
  1101. var self=this;
  1102. return smalltalk.withContext(function($ctx1) {
  1103. _st(self._model())._restart();
  1104. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},globals.HLStackListWidget)})},
  1105. args: [],
  1106. source: "restart\x0a\x09self model restart",
  1107. messageSends: ["restart", "model"],
  1108. referencedClasses: []
  1109. }),
  1110. globals.HLStackListWidget);
  1111. smalltalk.addMethod(
  1112. smalltalk.method({
  1113. selector: "selectItem:",
  1114. protocol: 'actions',
  1115. fn: function (aContext){
  1116. var self=this;
  1117. return smalltalk.withContext(function($ctx1) {
  1118. _st(self._model())._currentContext_(aContext);
  1119. globals.HLStackListWidget.superclass.fn.prototype._selectItem_.apply(_st(self), [aContext]);
  1120. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{aContext:aContext},globals.HLStackListWidget)})},
  1121. args: ["aContext"],
  1122. source: "selectItem: aContext\x0a \x09self model currentContext: aContext.\x0a\x09super selectItem: aContext",
  1123. messageSends: ["currentContext:", "model", "selectItem:"],
  1124. referencedClasses: []
  1125. }),
  1126. globals.HLStackListWidget);
  1127. smalltalk.addMethod(
  1128. smalltalk.method({
  1129. selector: "skip",
  1130. protocol: 'actions',
  1131. fn: function (){
  1132. var self=this;
  1133. return smalltalk.withContext(function($ctx1) {
  1134. _st(self._model())._skip();
  1135. return self}, function($ctx1) {$ctx1.fill(self,"skip",{},globals.HLStackListWidget)})},
  1136. args: [],
  1137. source: "skip\x0a\x09self model skip",
  1138. messageSends: ["skip", "model"],
  1139. referencedClasses: []
  1140. }),
  1141. globals.HLStackListWidget);
  1142. smalltalk.addMethod(
  1143. smalltalk.method({
  1144. selector: "stepOver",
  1145. protocol: 'actions',
  1146. fn: function (){
  1147. var self=this;
  1148. return smalltalk.withContext(function($ctx1) {
  1149. _st(self._model())._stepOver();
  1150. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},globals.HLStackListWidget)})},
  1151. args: [],
  1152. source: "stepOver\x0a\x09self model stepOver",
  1153. messageSends: ["stepOver", "model"],
  1154. referencedClasses: []
  1155. }),
  1156. globals.HLStackListWidget);
  1157. smalltalk.addMethod(
  1158. smalltalk.method({
  1159. selector: "where",
  1160. protocol: 'actions',
  1161. fn: function (){
  1162. var self=this;
  1163. return smalltalk.withContext(function($ctx1) {
  1164. _st(self._model())._where();
  1165. return self}, function($ctx1) {$ctx1.fill(self,"where",{},globals.HLStackListWidget)})},
  1166. args: [],
  1167. source: "where\x0a\x09self model where",
  1168. messageSends: ["where", "model"],
  1169. referencedClasses: []
  1170. }),
  1171. globals.HLStackListWidget);
  1172. });