1
0

Helios-Debugger.js 41 KB

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