Helios-Debugger.js 43 KB

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