Helios-Debugger.js 39 KB

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