Helios-Debugger.js 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115
  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. return smalltalk.withContext(function($ctx1) {
  108. var $2,$3,$4,$1;
  109. $2=self["@codeWidget"];
  110. if(($receiver = $2) == nil || $receiver == null){
  111. $3=_st($HLDebuggerCodeWidget())._new();
  112. _st($3)._browserModel_(self._model());
  113. $4=_st($3)._yourself();
  114. self["@codeWidget"]=$4;
  115. $1=self["@codeWidget"];
  116. } else {
  117. $1=$2;
  118. };
  119. return $1;
  120. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},globals.HLDebugger)})},
  121. args: [],
  122. source: "codeWidget\x0a\x09^ codeWidget ifNil: [ codeWidget := HLDebuggerCodeWidget new\x0a\x09\x09browserModel: self model;\x0a\x09\x09yourself ]",
  123. messageSends: ["ifNil:", "browserModel:", "new", "model", "yourself"],
  124. referencedClasses: ["HLDebuggerCodeWidget"]
  125. }),
  126. globals.HLDebugger);
  127. smalltalk.addMethod(
  128. smalltalk.method({
  129. selector: "focus",
  130. protocol: 'actions',
  131. fn: function (){
  132. var self=this;
  133. return smalltalk.withContext(function($ctx1) {
  134. _st(self._stackListWidget())._focus();
  135. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},globals.HLDebugger)})},
  136. args: [],
  137. source: "focus\x0a\x09self stackListWidget focus",
  138. messageSends: ["focus", "stackListWidget"],
  139. referencedClasses: []
  140. }),
  141. globals.HLDebugger);
  142. smalltalk.addMethod(
  143. smalltalk.method({
  144. selector: "initializeFromMethodContext:",
  145. protocol: 'accessing',
  146. fn: function (aMethodContext){
  147. var self=this;
  148. function $HLDebuggerModel(){return globals.HLDebuggerModel||(typeof HLDebuggerModel=="undefined"?nil:HLDebuggerModel)}
  149. return smalltalk.withContext(function($ctx1) {
  150. self["@model"]=_st($HLDebuggerModel())._on_(aMethodContext);
  151. self._observeModel();
  152. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromMethodContext:",{aMethodContext:aMethodContext},globals.HLDebugger)})},
  153. args: ["aMethodContext"],
  154. source: "initializeFromMethodContext: aMethodContext\x0a\x09model := HLDebuggerModel on: aMethodContext.\x0a\x09self observeModel",
  155. messageSends: ["on:", "observeModel"],
  156. referencedClasses: ["HLDebuggerModel"]
  157. }),
  158. globals.HLDebugger);
  159. smalltalk.addMethod(
  160. smalltalk.method({
  161. selector: "inspectorWidget",
  162. protocol: 'accessing',
  163. fn: function (){
  164. var self=this;
  165. function $HLInspectorWidget(){return globals.HLInspectorWidget||(typeof HLInspectorWidget=="undefined"?nil:HLInspectorWidget)}
  166. return smalltalk.withContext(function($ctx1) {
  167. var $2,$1;
  168. $2=self["@inspectorWidget"];
  169. if(($receiver = $2) == nil || $receiver == null){
  170. self["@inspectorWidget"]=_st($HLInspectorWidget())._new();
  171. $1=self["@inspectorWidget"];
  172. } else {
  173. $1=$2;
  174. };
  175. return $1;
  176. }, function($ctx1) {$ctx1.fill(self,"inspectorWidget",{},globals.HLDebugger)})},
  177. args: [],
  178. source: "inspectorWidget\x0a\x09^ inspectorWidget ifNil: [ \x0a\x09\x09inspectorWidget := HLInspectorWidget new ]",
  179. messageSends: ["ifNil:", "new"],
  180. referencedClasses: ["HLInspectorWidget"]
  181. }),
  182. globals.HLDebugger);
  183. smalltalk.addMethod(
  184. smalltalk.method({
  185. selector: "model",
  186. protocol: 'accessing',
  187. fn: function (){
  188. var self=this;
  189. function $HLDebuggerModel(){return globals.HLDebuggerModel||(typeof HLDebuggerModel=="undefined"?nil:HLDebuggerModel)}
  190. return smalltalk.withContext(function($ctx1) {
  191. var $2,$1;
  192. $2=self["@model"];
  193. if(($receiver = $2) == nil || $receiver == null){
  194. self["@model"]=_st($HLDebuggerModel())._new();
  195. $1=self["@model"];
  196. } else {
  197. $1=$2;
  198. };
  199. return $1;
  200. }, function($ctx1) {$ctx1.fill(self,"model",{},globals.HLDebugger)})},
  201. args: [],
  202. source: "model\x0a\x09^ model ifNil: [ model := HLDebuggerModel new ]",
  203. messageSends: ["ifNil:", "new"],
  204. referencedClasses: ["HLDebuggerModel"]
  205. }),
  206. globals.HLDebugger);
  207. smalltalk.addMethod(
  208. smalltalk.method({
  209. selector: "observeModel",
  210. protocol: 'actions',
  211. fn: function (){
  212. var self=this;
  213. function $HLDebuggerContextSelected(){return globals.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  214. function $HLDebuggerStepped(){return globals.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  215. return smalltalk.withContext(function($ctx1) {
  216. var $2,$1;
  217. $2=self._model();
  218. $ctx1.sendIdx["model"]=1;
  219. $1=_st($2)._announcer();
  220. $ctx1.sendIdx["announcer"]=1;
  221. _st($1)._on_send_to_($HLDebuggerContextSelected(),"onContextSelected:",self);
  222. $ctx1.sendIdx["on:send:to:"]=1;
  223. _st(_st(self._model())._announcer())._on_send_to_($HLDebuggerStepped(),"onContextSelected:",self);
  224. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},globals.HLDebugger)})},
  225. args: [],
  226. 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",
  227. messageSends: ["on:send:to:", "announcer", "model"],
  228. referencedClasses: ["HLDebuggerContextSelected", "HLDebuggerStepped"]
  229. }),
  230. globals.HLDebugger);
  231. smalltalk.addMethod(
  232. smalltalk.method({
  233. selector: "onContextSelected:",
  234. protocol: 'reactions',
  235. fn: function (anAnnouncement){
  236. var self=this;
  237. function $HLContextInspectorDecorator(){return globals.HLContextInspectorDecorator||(typeof HLContextInspectorDecorator=="undefined"?nil:HLContextInspectorDecorator)}
  238. return smalltalk.withContext(function($ctx1) {
  239. _st(self._inspectorWidget())._inspect_(_st($HLContextInspectorDecorator())._on_(_st(anAnnouncement)._context()));
  240. return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected:",{anAnnouncement:anAnnouncement},globals.HLDebugger)})},
  241. args: ["anAnnouncement"],
  242. source: "onContextSelected: anAnnouncement\x0a\x09self inspectorWidget inspect: (HLContextInspectorDecorator on: anAnnouncement context)",
  243. messageSends: ["inspect:", "inspectorWidget", "on:", "context"],
  244. referencedClasses: ["HLContextInspectorDecorator"]
  245. }),
  246. globals.HLDebugger);
  247. smalltalk.addMethod(
  248. smalltalk.method({
  249. selector: "registerBindingsOn:",
  250. protocol: 'keybindings',
  251. fn: function (aBindingGroup){
  252. var self=this;
  253. function $HLToolCommand(){return globals.HLToolCommand||(typeof HLToolCommand=="undefined"?nil:HLToolCommand)}
  254. return smalltalk.withContext(function($ctx1) {
  255. _st($HLToolCommand())._registerConcreteClassesOn_for_(aBindingGroup,self._model());
  256. return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup},globals.HLDebugger)})},
  257. args: ["aBindingGroup"],
  258. source: "registerBindingsOn: aBindingGroup\x0a\x09HLToolCommand \x0a\x09\x09registerConcreteClassesOn: aBindingGroup \x0a\x09\x09for: self model",
  259. messageSends: ["registerConcreteClassesOn:for:", "model"],
  260. referencedClasses: ["HLToolCommand"]
  261. }),
  262. globals.HLDebugger);
  263. smalltalk.addMethod(
  264. smalltalk.method({
  265. selector: "renderContentOn:",
  266. protocol: 'rendering',
  267. fn: function (html){
  268. var self=this;
  269. function $HLContainer(){return globals.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  270. function $HLHorizontalSplitter(){return globals.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  271. function $HLVerticalSplitter(){return globals.HLVerticalSplitter||(typeof HLVerticalSplitter=="undefined"?nil:HLVerticalSplitter)}
  272. return smalltalk.withContext(function($ctx1) {
  273. var $2,$1;
  274. $2=_st($HLHorizontalSplitter())._with_with_(self._stackListWidget(),_st($HLVerticalSplitter())._with_with_(self._codeWidget(),self._inspectorWidget()));
  275. $ctx1.sendIdx["with:with:"]=1;
  276. $1=_st($HLContainer())._with_($2);
  277. _st(html)._with_($1);
  278. $ctx1.sendIdx["with:"]=1;
  279. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLDebugger)})},
  280. args: ["html"],
  281. 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)))",
  282. messageSends: ["with:", "with:with:", "stackListWidget", "codeWidget", "inspectorWidget"],
  283. referencedClasses: ["HLContainer", "HLHorizontalSplitter", "HLVerticalSplitter"]
  284. }),
  285. globals.HLDebugger);
  286. smalltalk.addMethod(
  287. smalltalk.method({
  288. selector: "stackListWidget",
  289. protocol: 'accessing',
  290. fn: function (){
  291. var self=this;
  292. function $HLStackListWidget(){return globals.HLStackListWidget||(typeof HLStackListWidget=="undefined"?nil:HLStackListWidget)}
  293. return smalltalk.withContext(function($ctx1) {
  294. var $2,$3,$4,$1;
  295. $2=self["@stackListWidget"];
  296. if(($receiver = $2) == nil || $receiver == null){
  297. $3=_st($HLStackListWidget())._on_(self._model());
  298. _st($3)._next_(self._codeWidget());
  299. $4=_st($3)._yourself();
  300. self["@stackListWidget"]=$4;
  301. $1=self["@stackListWidget"];
  302. } else {
  303. $1=$2;
  304. };
  305. return $1;
  306. }, function($ctx1) {$ctx1.fill(self,"stackListWidget",{},globals.HLDebugger)})},
  307. args: [],
  308. source: "stackListWidget\x0a\x09^ stackListWidget ifNil: [ \x0a\x09\x09stackListWidget := (HLStackListWidget on: self model)\x0a\x09\x09\x09next: self codeWidget;\x0a\x09\x09\x09yourself ]",
  309. messageSends: ["ifNil:", "next:", "on:", "model", "codeWidget", "yourself"],
  310. referencedClasses: ["HLStackListWidget"]
  311. }),
  312. globals.HLDebugger);
  313. smalltalk.addMethod(
  314. smalltalk.method({
  315. selector: "unregister",
  316. protocol: 'actions',
  317. fn: function (){
  318. var self=this;
  319. return smalltalk.withContext(function($ctx1) {
  320. globals.HLDebugger.superclass.fn.prototype._unregister.apply(_st(self), []);
  321. $ctx1.sendIdx["unregister"]=1;
  322. _st(self._inspectorWidget())._unregister();
  323. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLDebugger)})},
  324. args: [],
  325. source: "unregister\x0a\x09super unregister.\x0a\x09self inspectorWidget unregister",
  326. messageSends: ["unregister", "inspectorWidget"],
  327. referencedClasses: []
  328. }),
  329. globals.HLDebugger);
  330. smalltalk.addMethod(
  331. smalltalk.method({
  332. selector: "on:",
  333. protocol: 'instance creation',
  334. fn: function (aMethodContext){
  335. var self=this;
  336. return smalltalk.withContext(function($ctx1) {
  337. var $2,$3,$1;
  338. $2=self._new();
  339. _st($2)._initializeFromMethodContext_(aMethodContext);
  340. $3=_st($2)._yourself();
  341. $1=$3;
  342. return $1;
  343. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},globals.HLDebugger.klass)})},
  344. args: ["aMethodContext"],
  345. source: "on: aMethodContext\x0a\x09^ self new\x0a\x09\x09initializeFromMethodContext: aMethodContext;\x0a\x09\x09yourself",
  346. messageSends: ["initializeFromMethodContext:", "new", "yourself"],
  347. referencedClasses: []
  348. }),
  349. globals.HLDebugger.klass);
  350. smalltalk.addMethod(
  351. smalltalk.method({
  352. selector: "tabClass",
  353. protocol: 'accessing',
  354. fn: function (){
  355. var self=this;
  356. return "debugger";
  357. },
  358. args: [],
  359. source: "tabClass\x0a\x09^ 'debugger'",
  360. messageSends: [],
  361. referencedClasses: []
  362. }),
  363. globals.HLDebugger.klass);
  364. smalltalk.addMethod(
  365. smalltalk.method({
  366. selector: "tabLabel",
  367. protocol: 'accessing',
  368. fn: function (){
  369. var self=this;
  370. return "Debugger";
  371. },
  372. args: [],
  373. source: "tabLabel\x0a\x09^ 'Debugger'",
  374. messageSends: [],
  375. referencedClasses: []
  376. }),
  377. globals.HLDebugger.klass);
  378. smalltalk.addClass('HLDebuggerCodeWidget', globals.HLBrowserCodeWidget, [], 'Helios-Debugger');
  379. smalltalk.addMethod(
  380. smalltalk.method({
  381. selector: "addStopAt:",
  382. protocol: 'actions',
  383. fn: function (anInteger){
  384. var self=this;
  385. return smalltalk.withContext(function($ctx1) {
  386. _st(self["@editor"])._setGutterMarker_gutter_value_(anInteger,"stops",_st(_st("<div class=\x22stop\x22></stop>"._asJQuery())._toArray())._first());
  387. return self}, function($ctx1) {$ctx1.fill(self,"addStopAt:",{anInteger:anInteger},globals.HLDebuggerCodeWidget)})},
  388. args: ["anInteger"],
  389. source: "addStopAt: anInteger\x0a\x09editor\x0a\x09\x09setGutterMarker: anInteger\x0a\x09\x09gutter: 'stops'\x0a\x09\x09value: '<div class=\x22stop\x22></stop>' asJQuery toArray first",
  390. messageSends: ["setGutterMarker:gutter:value:", "first", "toArray", "asJQuery"],
  391. referencedClasses: []
  392. }),
  393. globals.HLDebuggerCodeWidget);
  394. smalltalk.addMethod(
  395. smalltalk.method({
  396. selector: "clearHighlight",
  397. protocol: 'actions',
  398. fn: function (){
  399. var self=this;
  400. return smalltalk.withContext(function($ctx1) {
  401. _st(self._editor())._clearGutter_("stops");
  402. return self}, function($ctx1) {$ctx1.fill(self,"clearHighlight",{},globals.HLDebuggerCodeWidget)})},
  403. args: [],
  404. source: "clearHighlight\x0a\x09self editor clearGutter: 'stops'",
  405. messageSends: ["clearGutter:", "editor"],
  406. referencedClasses: []
  407. }),
  408. globals.HLDebuggerCodeWidget);
  409. smalltalk.addMethod(
  410. smalltalk.method({
  411. selector: "contents:",
  412. protocol: 'accessing',
  413. fn: function (aString){
  414. var self=this;
  415. return smalltalk.withContext(function($ctx1) {
  416. self._clearHighlight();
  417. globals.HLDebuggerCodeWidget.superclass.fn.prototype._contents_.apply(_st(self), [aString]);
  418. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},globals.HLDebuggerCodeWidget)})},
  419. args: ["aString"],
  420. source: "contents: aString\x0a\x09self clearHighlight.\x0a\x09super contents: aString",
  421. messageSends: ["clearHighlight", "contents:"],
  422. referencedClasses: []
  423. }),
  424. globals.HLDebuggerCodeWidget);
  425. smalltalk.addMethod(
  426. smalltalk.method({
  427. selector: "editorOptions",
  428. protocol: 'accessing',
  429. fn: function (){
  430. var self=this;
  431. return smalltalk.withContext(function($ctx1) {
  432. var $2,$3,$1;
  433. $2=globals.HLDebuggerCodeWidget.superclass.fn.prototype._editorOptions.apply(_st(self), []);
  434. _st($2)._at_put_("gutters",["CodeMirror-linenumbers", "stops"]);
  435. $3=_st($2)._yourself();
  436. $1=$3;
  437. return $1;
  438. }, function($ctx1) {$ctx1.fill(self,"editorOptions",{},globals.HLDebuggerCodeWidget)})},
  439. args: [],
  440. source: "editorOptions\x0a\x09^ super editorOptions\x0a\x09\x09at: 'gutters' put: #('CodeMirror-linenumbers' 'stops');\x0a\x09\x09yourself",
  441. messageSends: ["at:put:", "editorOptions", "yourself"],
  442. referencedClasses: []
  443. }),
  444. globals.HLDebuggerCodeWidget);
  445. smalltalk.addMethod(
  446. smalltalk.method({
  447. selector: "highlight",
  448. protocol: 'actions',
  449. fn: function (){
  450. var self=this;
  451. return smalltalk.withContext(function($ctx1) {
  452. self._highlightNode_(_st(self._browserModel())._nextNode());
  453. return self}, function($ctx1) {$ctx1.fill(self,"highlight",{},globals.HLDebuggerCodeWidget)})},
  454. args: [],
  455. source: "highlight\x0a\x09self highlightNode: self browserModel nextNode",
  456. messageSends: ["highlightNode:", "nextNode", "browserModel"],
  457. referencedClasses: []
  458. }),
  459. globals.HLDebuggerCodeWidget);
  460. smalltalk.addMethod(
  461. smalltalk.method({
  462. selector: "highlightNode:",
  463. protocol: 'actions',
  464. fn: function (aNode){
  465. var self=this;
  466. var token;
  467. return smalltalk.withContext(function($ctx1) {
  468. var $1,$6,$5,$4,$3,$9,$8,$7,$2,$13,$12,$11,$10,$14,$19,$18,$17,$16,$20,$15,$22,$21;
  469. if(($receiver = aNode) == nil || $receiver == null){
  470. aNode;
  471. } else {
  472. $1=self._editor();
  473. $ctx1.sendIdx["editor"]=1;
  474. $6=_st(aNode)._position();
  475. $ctx1.sendIdx["position"]=1;
  476. $5=_st($6)._x();
  477. $ctx1.sendIdx["x"]=1;
  478. $4=_st($5).__minus((1));
  479. $ctx1.sendIdx["-"]=1;
  480. $3="line".__minus_gt($4);
  481. $ctx1.sendIdx["->"]=1;
  482. $9=_st(aNode)._position();
  483. $ctx1.sendIdx["position"]=2;
  484. $8=_st($9)._y();
  485. $7="ch".__minus_gt($8);
  486. $ctx1.sendIdx["->"]=2;
  487. $2=globals.HashedCollection._from_([$3,$7]);
  488. token=_st($1)._getTokenAt_($2);
  489. token;
  490. self._clearHighlight();
  491. $13=_st(aNode)._position();
  492. $ctx1.sendIdx["position"]=3;
  493. $12=_st($13)._x();
  494. $ctx1.sendIdx["x"]=2;
  495. $11=_st($12).__minus((1));
  496. $ctx1.sendIdx["-"]=2;
  497. $10=self._addStopAt_($11);
  498. $10;
  499. $14=self._editor();
  500. $19=_st(aNode)._position();
  501. $ctx1.sendIdx["position"]=4;
  502. $18=_st($19)._x();
  503. $ctx1.sendIdx["x"]=3;
  504. $17=_st($18).__minus((1));
  505. $ctx1.sendIdx["-"]=3;
  506. $16="line".__minus_gt($17);
  507. $ctx1.sendIdx["->"]=3;
  508. $20="ch".__minus_gt(_st(token)._start());
  509. $ctx1.sendIdx["->"]=4;
  510. $15=globals.HashedCollection._from_([$16,$20]);
  511. $22="line".__minus_gt(_st(_st(_st(aNode)._position())._x()).__minus((1)));
  512. $ctx1.sendIdx["->"]=5;
  513. $21=globals.HashedCollection._from_([$22,"ch".__minus_gt(_st(token)._end())]);
  514. _st($14)._setSelection_to_($15,$21);
  515. };
  516. return self}, function($ctx1) {$ctx1.fill(self,"highlightNode:",{aNode:aNode,token:token},globals.HLDebuggerCodeWidget)})},
  517. args: ["aNode"],
  518. source: "highlightNode: aNode\x0a\x09| token |\x0a\x09\x0a\x09aNode ifNotNil: [\x0a\x09\x09token := self editor getTokenAt: #{ \x0a\x09\x09\x09'line' -> (aNode position x - 1). \x0a\x09\x09\x09'ch' -> aNode position y \x0a\x09\x09}.\x0a\x0a\x09\x09self\x0a\x09\x09\x09clearHighlight;\x0a\x09\x09\x09addStopAt: aNode position x - 1.\x0a\x0a\x09\x09self editor \x0a\x09\x09\x09setSelection: #{ 'line' -> (aNode position x - 1). 'ch' -> token start }\x0a\x09\x09\x09to: #{ 'line' -> (aNode position x - 1). 'ch' -> token end } ]",
  519. messageSends: ["ifNotNil:", "getTokenAt:", "editor", "->", "-", "x", "position", "y", "clearHighlight", "addStopAt:", "setSelection:to:", "start", "end"],
  520. referencedClasses: []
  521. }),
  522. globals.HLDebuggerCodeWidget);
  523. smalltalk.addMethod(
  524. smalltalk.method({
  525. selector: "observeBrowserModel",
  526. protocol: 'actions',
  527. fn: function (){
  528. var self=this;
  529. function $HLDebuggerContextSelected(){return globals.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  530. function $HLDebuggerStepped(){return globals.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  531. function $HLDebuggerWhere(){return globals.HLDebuggerWhere||(typeof HLDebuggerWhere=="undefined"?nil:HLDebuggerWhere)}
  532. return smalltalk.withContext(function($ctx1) {
  533. var $2,$1,$4,$3;
  534. globals.HLDebuggerCodeWidget.superclass.fn.prototype._observeBrowserModel.apply(_st(self), []);
  535. $2=self._browserModel();
  536. $ctx1.sendIdx["browserModel"]=1;
  537. $1=_st($2)._announcer();
  538. $ctx1.sendIdx["announcer"]=1;
  539. _st($1)._on_send_to_($HLDebuggerContextSelected(),"onContextSelected",self);
  540. $ctx1.sendIdx["on:send:to:"]=1;
  541. $4=self._browserModel();
  542. $ctx1.sendIdx["browserModel"]=2;
  543. $3=_st($4)._announcer();
  544. $ctx1.sendIdx["announcer"]=2;
  545. _st($3)._on_send_to_($HLDebuggerStepped(),"onContextSelected",self);
  546. $ctx1.sendIdx["on:send:to:"]=2;
  547. _st(_st(self._browserModel())._announcer())._on_send_to_($HLDebuggerWhere(),"onContextSelected",self);
  548. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},globals.HLDebuggerCodeWidget)})},
  549. args: [],
  550. 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",
  551. messageSends: ["observeBrowserModel", "on:send:to:", "announcer", "browserModel"],
  552. referencedClasses: ["HLDebuggerContextSelected", "HLDebuggerStepped", "HLDebuggerWhere"]
  553. }),
  554. globals.HLDebuggerCodeWidget);
  555. smalltalk.addMethod(
  556. smalltalk.method({
  557. selector: "onContextSelected",
  558. protocol: 'reactions',
  559. fn: function (){
  560. var self=this;
  561. return smalltalk.withContext(function($ctx1) {
  562. self._highlight();
  563. return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected",{},globals.HLDebuggerCodeWidget)})},
  564. args: [],
  565. source: "onContextSelected\x0a\x09self highlight",
  566. messageSends: ["highlight"],
  567. referencedClasses: []
  568. }),
  569. globals.HLDebuggerCodeWidget);
  570. smalltalk.addClass('HLDebuggerModel', globals.HLToolModel, ['rootContext', 'currentContext', 'contexts'], 'Helios-Debugger');
  571. globals.HLDebuggerModel.comment="I am a model for Helios debugging.\x0a\x0aMy instances hold a reference to an `AIContext` instance, built from a `MethodContext`. The context should be the root of the context stack.";
  572. smalltalk.addMethod(
  573. smalltalk.method({
  574. selector: "contexts",
  575. protocol: 'accessing',
  576. fn: function (){
  577. var self=this;
  578. var $1;
  579. $1=self["@contexts"];
  580. return $1;
  581. },
  582. args: [],
  583. source: "contexts\x0a\x09^ contexts",
  584. messageSends: [],
  585. referencedClasses: []
  586. }),
  587. globals.HLDebuggerModel);
  588. smalltalk.addMethod(
  589. smalltalk.method({
  590. selector: "currentContext",
  591. protocol: 'accessing',
  592. fn: function (){
  593. var self=this;
  594. return smalltalk.withContext(function($ctx1) {
  595. var $1,$2;
  596. $1=self["@currentContext"];
  597. if(($receiver = $1) == nil || $receiver == null){
  598. self._currentContext_(self._rootContext());
  599. } else {
  600. $1;
  601. };
  602. $2=self["@currentContext"];
  603. return $2;
  604. }, function($ctx1) {$ctx1.fill(self,"currentContext",{},globals.HLDebuggerModel)})},
  605. args: [],
  606. source: "currentContext\x0a\x09currentContext ifNil: [ self currentContext: self rootContext ].\x0a\x09^ currentContext",
  607. messageSends: ["ifNil:", "currentContext:", "rootContext"],
  608. referencedClasses: []
  609. }),
  610. globals.HLDebuggerModel);
  611. smalltalk.addMethod(
  612. smalltalk.method({
  613. selector: "currentContext:",
  614. protocol: 'accessing',
  615. fn: function (aContext){
  616. var self=this;
  617. function $HLDebuggerContextSelected(){return globals.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  618. return smalltalk.withContext(function($ctx1) {
  619. var $1,$2;
  620. self._withChangesDo_((function(){
  621. return smalltalk.withContext(function($ctx2) {
  622. self._selectedMethod_(_st(aContext)._method());
  623. self["@currentContext"]=aContext;
  624. self["@currentContext"];
  625. $1=_st($HLDebuggerContextSelected())._new();
  626. _st($1)._context_(aContext);
  627. $2=_st($1)._yourself();
  628. return _st(self._announcer())._announce_($2);
  629. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  630. return self}, function($ctx1) {$ctx1.fill(self,"currentContext:",{aContext:aContext},globals.HLDebuggerModel)})},
  631. args: ["aContext"],
  632. 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) ]",
  633. messageSends: ["withChangesDo:", "selectedMethod:", "method", "announce:", "announcer", "context:", "new", "yourself"],
  634. referencedClasses: ["HLDebuggerContextSelected"]
  635. }),
  636. globals.HLDebuggerModel);
  637. smalltalk.addMethod(
  638. smalltalk.method({
  639. selector: "initializeContexts",
  640. protocol: 'initialization',
  641. fn: function (){
  642. var self=this;
  643. var context;
  644. function $OrderedCollection(){return globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  645. return smalltalk.withContext(function($ctx1) {
  646. self["@contexts"]=_st($OrderedCollection())._new();
  647. context=self._rootContext();
  648. _st((function(){
  649. return smalltalk.withContext(function($ctx2) {
  650. return _st(context)._notNil();
  651. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileTrue_((function(){
  652. return smalltalk.withContext(function($ctx2) {
  653. _st(self["@contexts"])._add_(context);
  654. context=_st(context)._outerContext();
  655. return context;
  656. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  657. return self}, function($ctx1) {$ctx1.fill(self,"initializeContexts",{context:context},globals.HLDebuggerModel)})},
  658. args: [],
  659. 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 ]",
  660. messageSends: ["new", "rootContext", "whileTrue:", "notNil", "add:", "outerContext"],
  661. referencedClasses: ["OrderedCollection"]
  662. }),
  663. globals.HLDebuggerModel);
  664. smalltalk.addMethod(
  665. smalltalk.method({
  666. selector: "initializeFromContext:",
  667. protocol: 'initialization',
  668. fn: function (aMethodContext){
  669. var self=this;
  670. function $AIContext(){return globals.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  671. return smalltalk.withContext(function($ctx1) {
  672. self["@rootContext"]=_st($AIContext())._fromMethodContext_(aMethodContext);
  673. self._initializeContexts();
  674. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromContext:",{aMethodContext:aMethodContext},globals.HLDebuggerModel)})},
  675. args: ["aMethodContext"],
  676. source: "initializeFromContext: aMethodContext\x0a\x09rootContext := AIContext fromMethodContext: aMethodContext.\x0a\x09self initializeContexts",
  677. messageSends: ["fromMethodContext:", "initializeContexts"],
  678. referencedClasses: ["AIContext"]
  679. }),
  680. globals.HLDebuggerModel);
  681. smalltalk.addMethod(
  682. smalltalk.method({
  683. selector: "interpreter",
  684. protocol: 'accessing',
  685. fn: function (){
  686. var self=this;
  687. return smalltalk.withContext(function($ctx1) {
  688. var $1;
  689. $1=_st(self._currentContext())._interpreter();
  690. return $1;
  691. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},globals.HLDebuggerModel)})},
  692. args: [],
  693. source: "interpreter\x0a\x09^ self currentContext interpreter",
  694. messageSends: ["interpreter", "currentContext"],
  695. referencedClasses: []
  696. }),
  697. globals.HLDebuggerModel);
  698. smalltalk.addMethod(
  699. smalltalk.method({
  700. selector: "nextNode",
  701. protocol: 'accessing',
  702. fn: function (){
  703. var self=this;
  704. return smalltalk.withContext(function($ctx1) {
  705. var $1;
  706. $1=_st(self._interpreter())._node();
  707. return $1;
  708. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},globals.HLDebuggerModel)})},
  709. args: [],
  710. source: "nextNode\x0a\x09^ self interpreter node",
  711. messageSends: ["node", "interpreter"],
  712. referencedClasses: []
  713. }),
  714. globals.HLDebuggerModel);
  715. smalltalk.addMethod(
  716. smalltalk.method({
  717. selector: "restart",
  718. protocol: 'actions',
  719. fn: function (){
  720. var self=this;
  721. function $HLDebuggerStepped(){return globals.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  722. return smalltalk.withContext(function($ctx1) {
  723. var $1,$2;
  724. _st(self._interpreter())._restart();
  725. $1=_st($HLDebuggerStepped())._new();
  726. _st($1)._context_(self._currentContext());
  727. $2=_st($1)._yourself();
  728. _st(self._announcer())._announce_($2);
  729. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},globals.HLDebuggerModel)})},
  730. args: [],
  731. source: "restart\x0a\x09self interpreter restart.\x0a\x09self announcer announce: (HLDebuggerStepped new\x0a\x09\x09context: self currentContext;\x0a\x09\x09yourself)",
  732. messageSends: ["restart", "interpreter", "announce:", "announcer", "context:", "new", "currentContext", "yourself"],
  733. referencedClasses: ["HLDebuggerStepped"]
  734. }),
  735. globals.HLDebuggerModel);
  736. smalltalk.addMethod(
  737. smalltalk.method({
  738. selector: "rootContext",
  739. protocol: 'accessing',
  740. fn: function (){
  741. var self=this;
  742. var $1;
  743. $1=self["@rootContext"];
  744. return $1;
  745. },
  746. args: [],
  747. source: "rootContext\x0a\x09^ rootContext",
  748. messageSends: [],
  749. referencedClasses: []
  750. }),
  751. globals.HLDebuggerModel);
  752. smalltalk.addMethod(
  753. smalltalk.method({
  754. selector: "skip",
  755. protocol: 'actions',
  756. fn: function (){
  757. var self=this;
  758. function $HLDebuggerStepped(){return globals.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  759. return smalltalk.withContext(function($ctx1) {
  760. var $1,$2;
  761. _st(self._interpreter())._skip();
  762. $1=_st($HLDebuggerStepped())._new();
  763. _st($1)._context_(self._currentContext());
  764. $2=_st($1)._yourself();
  765. _st(self._announcer())._announce_($2);
  766. return self}, function($ctx1) {$ctx1.fill(self,"skip",{},globals.HLDebuggerModel)})},
  767. args: [],
  768. source: "skip\x0a\x09self interpreter skip.\x0a\x09self announcer announce: (HLDebuggerStepped new\x0a\x09\x09context: self currentContext;\x0a\x09\x09yourself)",
  769. messageSends: ["skip", "interpreter", "announce:", "announcer", "context:", "new", "currentContext", "yourself"],
  770. referencedClasses: ["HLDebuggerStepped"]
  771. }),
  772. globals.HLDebuggerModel);
  773. smalltalk.addMethod(
  774. smalltalk.method({
  775. selector: "stepOver",
  776. protocol: 'actions',
  777. fn: function (){
  778. var self=this;
  779. function $HLDebuggerStepped(){return globals.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  780. return smalltalk.withContext(function($ctx1) {
  781. var $1,$2;
  782. _st(self._interpreter())._stepOver();
  783. $1=_st($HLDebuggerStepped())._new();
  784. _st($1)._context_(self._currentContext());
  785. $2=_st($1)._yourself();
  786. _st(self._announcer())._announce_($2);
  787. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},globals.HLDebuggerModel)})},
  788. args: [],
  789. source: "stepOver\x0a\x09self interpreter stepOver.\x0a\x09self announcer announce: (HLDebuggerStepped new\x0a\x09\x09context: self currentContext;\x0a\x09\x09yourself)",
  790. messageSends: ["stepOver", "interpreter", "announce:", "announcer", "context:", "new", "currentContext", "yourself"],
  791. referencedClasses: ["HLDebuggerStepped"]
  792. }),
  793. globals.HLDebuggerModel);
  794. smalltalk.addMethod(
  795. smalltalk.method({
  796. selector: "where",
  797. protocol: 'actions',
  798. fn: function (){
  799. var self=this;
  800. function $HLDebuggerWhere(){return globals.HLDebuggerWhere||(typeof HLDebuggerWhere=="undefined"?nil:HLDebuggerWhere)}
  801. return smalltalk.withContext(function($ctx1) {
  802. _st(self._announcer())._announce_(_st($HLDebuggerWhere())._new());
  803. return self}, function($ctx1) {$ctx1.fill(self,"where",{},globals.HLDebuggerModel)})},
  804. args: [],
  805. source: "where\x0a\x09self announcer announce: HLDebuggerWhere new",
  806. messageSends: ["announce:", "announcer", "new"],
  807. referencedClasses: ["HLDebuggerWhere"]
  808. }),
  809. globals.HLDebuggerModel);
  810. smalltalk.addMethod(
  811. smalltalk.method({
  812. selector: "on:",
  813. protocol: 'instance creation',
  814. fn: function (aMethodContext){
  815. var self=this;
  816. return smalltalk.withContext(function($ctx1) {
  817. var $2,$3,$1;
  818. $2=self._new();
  819. _st($2)._initializeFromContext_(aMethodContext);
  820. $3=_st($2)._yourself();
  821. $1=$3;
  822. return $1;
  823. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},globals.HLDebuggerModel.klass)})},
  824. args: ["aMethodContext"],
  825. source: "on: aMethodContext\x0a\x09^ self new\x0a\x09\x09initializeFromContext: aMethodContext;\x0a\x09\x09yourself",
  826. messageSends: ["initializeFromContext:", "new", "yourself"],
  827. referencedClasses: []
  828. }),
  829. globals.HLDebuggerModel.klass);
  830. smalltalk.addClass('HLErrorHandler', globals.Object, [], 'Helios-Debugger');
  831. smalltalk.addMethod(
  832. smalltalk.method({
  833. selector: "handleError:",
  834. protocol: 'error handling',
  835. fn: function (anError){
  836. var self=this;
  837. function $HLDebugger(){return globals.HLDebugger||(typeof HLDebugger=="undefined"?nil:HLDebugger)}
  838. function $Error(){return globals.Error||(typeof Error=="undefined"?nil:Error)}
  839. function $ErrorHandler(){return globals.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  840. return smalltalk.withContext(function($ctx1) {
  841. self._onErrorHandled();
  842. _st((function(){
  843. return smalltalk.withContext(function($ctx2) {
  844. return _st(_st($HLDebugger())._on_(_st(anError)._context()))._openAsTab();
  845. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($Error(),(function(error){
  846. return smalltalk.withContext(function($ctx2) {
  847. return _st(_st($ErrorHandler())._new())._handleError_(error);
  848. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1,2)})}));
  849. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},globals.HLErrorHandler)})},
  850. args: ["anError"],
  851. 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 ]",
  852. messageSends: ["onErrorHandled", "on:do:", "openAsTab", "on:", "context", "handleError:", "new"],
  853. referencedClasses: ["HLDebugger", "Error", "ErrorHandler"]
  854. }),
  855. globals.HLErrorHandler);
  856. smalltalk.addMethod(
  857. smalltalk.method({
  858. selector: "onErrorHandled",
  859. protocol: 'error handling',
  860. fn: function (){
  861. var self=this;
  862. function $HLProgressWidget(){return globals.HLProgressWidget||(typeof HLProgressWidget=="undefined"?nil:HLProgressWidget)}
  863. return smalltalk.withContext(function($ctx1) {
  864. var $1,$2;
  865. $1=_st($HLProgressWidget())._default();
  866. _st($1)._flush();
  867. $2=_st($1)._remove();
  868. return self}, function($ctx1) {$ctx1.fill(self,"onErrorHandled",{},globals.HLErrorHandler)})},
  869. args: [],
  870. 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",
  871. messageSends: ["flush", "default", "remove"],
  872. referencedClasses: ["HLProgressWidget"]
  873. }),
  874. globals.HLErrorHandler);
  875. smalltalk.addClass('HLStackListWidget', globals.HLToolListWidget, [], 'Helios-Debugger');
  876. smalltalk.addMethod(
  877. smalltalk.method({
  878. selector: "items",
  879. protocol: 'accessing',
  880. fn: function (){
  881. var self=this;
  882. return smalltalk.withContext(function($ctx1) {
  883. var $2,$1;
  884. $2=self["@items"];
  885. if(($receiver = $2) == nil || $receiver == null){
  886. self["@items"]=_st(self._model())._contexts();
  887. $1=self["@items"];
  888. } else {
  889. $1=$2;
  890. };
  891. return $1;
  892. }, function($ctx1) {$ctx1.fill(self,"items",{},globals.HLStackListWidget)})},
  893. args: [],
  894. source: "items\x0a\x09^ items ifNil: [ items := self model contexts ]",
  895. messageSends: ["ifNil:", "contexts", "model"],
  896. referencedClasses: []
  897. }),
  898. globals.HLStackListWidget);
  899. smalltalk.addMethod(
  900. smalltalk.method({
  901. selector: "label",
  902. protocol: 'accessing',
  903. fn: function (){
  904. var self=this;
  905. return "Call stack";
  906. },
  907. args: [],
  908. source: "label\x0a\x09^ 'Call stack'",
  909. messageSends: [],
  910. referencedClasses: []
  911. }),
  912. globals.HLStackListWidget);
  913. smalltalk.addMethod(
  914. smalltalk.method({
  915. selector: "renderButtonsOn:",
  916. protocol: 'rendering',
  917. fn: function (html){
  918. var self=this;
  919. return smalltalk.withContext(function($ctx1) {
  920. var $1,$3,$4,$5,$6,$7,$8,$9,$10,$2;
  921. $1=_st(html)._div();
  922. _st($1)._class_("debugger_bar");
  923. $ctx1.sendIdx["class:"]=1;
  924. $2=_st($1)._with_((function(){
  925. return smalltalk.withContext(function($ctx2) {
  926. $3=_st(html)._button();
  927. $ctx2.sendIdx["button"]=1;
  928. _st($3)._class_("btn restart");
  929. $ctx2.sendIdx["class:"]=2;
  930. _st($3)._with_("Restart");
  931. $ctx2.sendIdx["with:"]=2;
  932. $4=_st($3)._onClick_((function(){
  933. return smalltalk.withContext(function($ctx3) {
  934. return self._restart();
  935. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  936. $ctx2.sendIdx["onClick:"]=1;
  937. $4;
  938. $5=_st(html)._button();
  939. $ctx2.sendIdx["button"]=2;
  940. _st($5)._class_("btn where");
  941. $ctx2.sendIdx["class:"]=3;
  942. _st($5)._with_("Where");
  943. $ctx2.sendIdx["with:"]=3;
  944. $6=_st($5)._onClick_((function(){
  945. return smalltalk.withContext(function($ctx3) {
  946. return self._where();
  947. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  948. $ctx2.sendIdx["onClick:"]=2;
  949. $6;
  950. $7=_st(html)._button();
  951. $ctx2.sendIdx["button"]=3;
  952. _st($7)._class_("btn stepOver");
  953. $ctx2.sendIdx["class:"]=4;
  954. _st($7)._with_("Step over");
  955. $ctx2.sendIdx["with:"]=4;
  956. $8=_st($7)._onClick_((function(){
  957. return smalltalk.withContext(function($ctx3) {
  958. return self._stepOver();
  959. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
  960. $ctx2.sendIdx["onClick:"]=3;
  961. $8;
  962. $9=_st(html)._button();
  963. _st($9)._class_("btn skip");
  964. _st($9)._with_("Skip");
  965. $10=_st($9)._onClick_((function(){
  966. return smalltalk.withContext(function($ctx3) {
  967. return self._skip();
  968. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,5)})}));
  969. return $10;
  970. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  971. $ctx1.sendIdx["with:"]=1;
  972. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},globals.HLStackListWidget)})},
  973. args: ["html"],
  974. 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 ] ]",
  975. messageSends: ["class:", "div", "with:", "button", "onClick:", "restart", "where", "stepOver", "skip"],
  976. referencedClasses: []
  977. }),
  978. globals.HLStackListWidget);
  979. smalltalk.addMethod(
  980. smalltalk.method({
  981. selector: "restart",
  982. protocol: 'actions',
  983. fn: function (){
  984. var self=this;
  985. return smalltalk.withContext(function($ctx1) {
  986. _st(self._model())._restart();
  987. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},globals.HLStackListWidget)})},
  988. args: [],
  989. source: "restart\x0a\x09self model restart",
  990. messageSends: ["restart", "model"],
  991. referencedClasses: []
  992. }),
  993. globals.HLStackListWidget);
  994. smalltalk.addMethod(
  995. smalltalk.method({
  996. selector: "selectItem:",
  997. protocol: 'actions',
  998. fn: function (aContext){
  999. var self=this;
  1000. return smalltalk.withContext(function($ctx1) {
  1001. _st(self._model())._currentContext_(aContext);
  1002. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{aContext:aContext},globals.HLStackListWidget)})},
  1003. args: ["aContext"],
  1004. source: "selectItem: aContext\x0a \x09self model currentContext: aContext",
  1005. messageSends: ["currentContext:", "model"],
  1006. referencedClasses: []
  1007. }),
  1008. globals.HLStackListWidget);
  1009. smalltalk.addMethod(
  1010. smalltalk.method({
  1011. selector: "skip",
  1012. protocol: 'actions',
  1013. fn: function (){
  1014. var self=this;
  1015. return smalltalk.withContext(function($ctx1) {
  1016. _st(self._model())._skip();
  1017. return self}, function($ctx1) {$ctx1.fill(self,"skip",{},globals.HLStackListWidget)})},
  1018. args: [],
  1019. source: "skip\x0a\x09self model skip",
  1020. messageSends: ["skip", "model"],
  1021. referencedClasses: []
  1022. }),
  1023. globals.HLStackListWidget);
  1024. smalltalk.addMethod(
  1025. smalltalk.method({
  1026. selector: "stepOver",
  1027. protocol: 'actions',
  1028. fn: function (){
  1029. var self=this;
  1030. return smalltalk.withContext(function($ctx1) {
  1031. _st(self._model())._stepOver();
  1032. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},globals.HLStackListWidget)})},
  1033. args: [],
  1034. source: "stepOver\x0a\x09self model stepOver",
  1035. messageSends: ["stepOver", "model"],
  1036. referencedClasses: []
  1037. }),
  1038. globals.HLStackListWidget);
  1039. smalltalk.addMethod(
  1040. smalltalk.method({
  1041. selector: "where",
  1042. protocol: 'actions',
  1043. fn: function (){
  1044. var self=this;
  1045. return smalltalk.withContext(function($ctx1) {
  1046. _st(self._model())._where();
  1047. return self}, function($ctx1) {$ctx1.fill(self,"where",{},globals.HLStackListWidget)})},
  1048. args: [],
  1049. source: "where\x0a\x09self model where",
  1050. messageSends: ["where", "model"],
  1051. referencedClasses: []
  1052. }),
  1053. globals.HLStackListWidget);
  1054. });