Helios-Debugger.js 43 KB

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