Helios-Debugger.js 41 KB

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