Helios-Debugger.js 46 KB

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