Helios-Debugger.js 39 KB

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