Helios-Debugger.js 41 KB

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