{"id":177,"date":"2009-02-19T07:45:28","date_gmt":"2009-02-19T12:45:28","guid":{"rendered":"http:\/\/www.visophyte.org\/blog\/?p=177"},"modified":"2009-02-19T07:45:28","modified_gmt":"2009-02-19T12:45:28","slug":"dxrpy-with-references-against-mailnews-plus-bespin-wishes","status":"publish","type":"post","link":"https:\/\/www.visophyte.org\/blog\/2009\/02\/19\/dxrpy-with-references-against-mailnews-plus-bespin-wishes\/","title":{"rendered":"dxrpy with references against mailnews, plus bespin wishes"},"content":{"rendered":"<p><a href=\"http:\/\/clicky.visophyte.org\/examples\/dxrpy\/20090219-01\/decls\/nsIMsgFolder\/Delete.html\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-178\" title=\"dxrpy-nsimsgfolder-delete\" src=\"http:\/\/www.visophyte.org\/blog\/wp-content\/uploads\/2009\/02\/dxrpy-nsimsgfolder-delete.png\" alt=\"dxrpy-nsimsgfolder-delete\" width=\"606\" height=\"354\" srcset=\"https:\/\/www.visophyte.org\/blog\/wp-content\/uploads\/2009\/02\/dxrpy-nsimsgfolder-delete.png 606w, https:\/\/www.visophyte.org\/blog\/wp-content\/uploads\/2009\/02\/dxrpy-nsimsgfolder-delete-600x350.png 600w, https:\/\/www.visophyte.org\/blog\/wp-content\/uploads\/2009\/02\/dxrpy-nsimsgfolder-delete-300x175.png 300w\" sizes=\"auto, (max-width: 606px) 100vw, 606px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/benjamin.smedbergs.us\/blog\/\">bsmedberg<\/a>&#8216;s <a href=\"http:\/\/hg.mozilla.org\/users\/bsmedberg_mozilla.com\/dxrpy\/\">dxrpy<\/a> likes to generate documentation using <a href=\"https:\/\/developer.mozilla.org\/en\/Dehydra\">dehydra<\/a> (bsmedberg&#8217;s blog posts on this: <a href=\"http:\/\/benjamin.smedbergs.us\/blog\/2008-09-30\/generating-documentation-with-dehydra\/\">1<\/a> <a href=\"http:\/\/benjamin.smedbergs.us\/blog\/2008-11-26\/generated-documetation-part-2\/\">2<\/a>).\u00a0 I have added support for references\/referencedBy extraction and otherwise wailed on it a little bit, and run this against JUST comm-central&#8217;s mailnews\/ directory.\u00a0 The collection process is still strictly serial, and there&#8217;s a lot of stuff in mozilla-central\/comm-central, which is why the subset.\u00a0 You can find the outputs <a href=\"http:\/\/clicky.visophyte.org\/examples\/dxrpy\/20090219-01\/decls\/\">here<\/a>.\u00a0 My repository with my changes is <a href=\"http:\/\/hg.mozilla.org\/users\/bugmail_asutherland.org\/dxrpy\/\">here<\/a>.\u00a0 There are all kinds of issues and limitations, of course.<\/p>\n<p>The picture above is of <a href=\"http:\/\/clicky.visophyte.org\/examples\/dxrpy\/20090219-01\/decls\/nsIMsgFolder\/Delete.html\">nsIMsgFolder::Delete()<\/a>, the major advantage over <a href=\"http:\/\/mxr.mozilla.org\/comm-central\/ident?i=Delete&amp;tree=comm-central&amp;filter=\">mxr<\/a> being that we&#8217;re not going to have ambiguity from completely unrelated Delete methods.\u00a0 Note that in the mxr link I am cheating by not filtering to mailnews\/, but the point is that with dxrpy you don&#8217;t need to do that.\u00a0 The picture below shows a slice of the &#8216;references&#8217; information for <a href=\"http:\/\/clicky.visophyte.org\/examples\/dxrpy\/20090219-01\/decls\/nsMsgDBView\/index.html\">nsMsgDBView<\/a>::<a href=\"http:\/\/clicky.visophyte.org\/examples\/dxrpy\/20090219-01\/decls\/nsMsgDBView\/Sort.html\">Sort<\/a>.\u00a0 Another thing you could see is <a href=\"http:\/\/clicky.visophyte.org\/examples\/dxrpy\/20090219-01\/decls\/nsVoidArray\/~nsVoidArray.html\">who is using nsVoidArray<\/a> (in mailnews\/!) by virtue of <a href=\"http:\/\/clicky.visophyte.org\/examples\/dxrpy\/20090219-01\/decls\/nsVoidArray\/~nsVoidArray.html\">referencing its destructor<\/a>.<\/p>\n<p><a href=\"http:\/\/clicky.visophyte.org\/examples\/dxrpy\/20090219-01\/decls\/nsMsgDBView\/Sort.html\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-179\" title=\"dxrpy-nsmsgdbview-sort-references\" src=\"http:\/\/www.visophyte.org\/blog\/wp-content\/uploads\/2009\/02\/dxrpy-nsmsgdbview-sort-references.png\" alt=\"dxrpy-nsmsgdbview-sort-references\" width=\"588\" height=\"429\" srcset=\"https:\/\/www.visophyte.org\/blog\/wp-content\/uploads\/2009\/02\/dxrpy-nsmsgdbview-sort-references.png 588w, https:\/\/www.visophyte.org\/blog\/wp-content\/uploads\/2009\/02\/dxrpy-nsmsgdbview-sort-references-300x218.png 300w\" sizes=\"auto, (max-width: 588px) 100vw, 588px\" \/><\/a><\/p>\n<p>My interest in this is a continuation of my efforts on <a href=\"http:\/\/www.visophyte.org\/blog\/tag\/pecobro\/\">pecobro <\/a>to provide an interface to expose performance information from various means of instrumentation.\u00a0 That such a thing requires a useful interface substrate is just a nice surprise.\u00a0 The dehydra C++ stuff complements the references\/referenced by work <a href=\"http:\/\/www.visophyte.org\/blog\/2008\/05\/20\/pecobro-the-tell-you-who-readswrites-what-performance-code-browser\/\">I did for javascript in pecobro<\/a>.\u00a0 Eventually I would hope to use the <a href=\"http:\/\/quetzalcoatal.blogspot.com\/2009\/01\/jshydra.html\">jshydra infrastructure<\/a> to accomplish the js stuff since the parser pecobro uses is an unholy\/brittle thing, and a usable jshydra would have all kinds of other exciting uses.<\/p>\n<p>Things I would be very happy for other people to magically do so I don&#8217;t need to do them:<\/p>\n<ul>\n<li>Magic up <a href=\"http:\/\/labs.mozilla.com\/projects\/bespin\/\">bespin<\/a> so that it can pull files out of hg.mozilla.org.\u00a0 One of the significant reasons I did not do more work on pecobro is that the approach of syntax highlighting in DOM explodes quite badly when confronted with source files you might find in mozilla-central\/comm-central.<\/li>\n<li>Make dxrpy generate json files representing the information it knows about each source file (positions =&gt; semantic info) as well as each function (positions in a function of references=&gt; semantic info on those references).<\/li>\n<li>Make bespin retrieve those json files when the file is loaded so that its naive syntax highlighting can be augmented to correlate with that semantic info.\u00a0 One could attempt to be clever and use simple regexes or something to allow this information to be maintained while you edit the file, but I only need bespin to be read-only.<\/li>\n<li>Make it easy for bespin to use that info to follow references and return without sucking.<\/li>\n<li>Make something that extracts stack-traces from socorro and clusters this information by class, sticking it in static json files too, why not.<\/li>\n<li>Make bespin use its semantic and just general line number info to grab the stack-trace crash info so that it can highlight code in bespin that is suspected to be crashy.\u00a0 (You would probably want to get clever about determining what is a potentially innocent frame in the trace and what should be considered actually crasy.\u00a0 Knowing when you&#8217;re calling out of your module is probably a simple and useful heuristic.)<\/li>\n<li>Make something that chews the crash stacks with the dehydra\/dxrpy data to make a visualization of where the crasy stuff is happening, module-wise.)<\/li>\n<li>Make bespin retrieve json files of file\/class-oriented json files that my performance tooling generates, letting me display <a href=\"http:\/\/www.visophyte.org\/blog\/2008\/04\/08\/pecobro-the-performance-code-browser-early-stage\/\">cool sparkline\/sparkbar things<\/a> in the source.<\/li>\n<li>Cleanup\/infrastructurization of dxrpy&#8217;s generation\/display mechanisms.\u00a0 My greatest need of dxrpy is actually a coherent framework that can easily integrate with bespin.\u00a0 The tricky part for my performance work is the javascript side of the equation, and the pecobro tooling actually does pretty well there.\u00a0 It just wants to have a migration path and an interface that doesn&#8217;t cause firefox to lock up every time I change syntax-highlighted documents&#8230;<\/li>\n<\/ul>\n<p>And if anyone already has a tool that is basically a statistical profiler that can do stack-traces that fully understand the interleaved nature of the C++ and spidermonkey JS stacks, that would be great.\u00a0 (Bonus points for working with the JIT enabled!)\u00a0 My dream would be a timer-driven VProbe based solution; then I could run things against a replay and avoid distortion of the timescale while also allowing for a realistic user experience in generating the trace.\u00a0 I would like to avoid having to do trace reconstruction as I have done most recently with dtrace and chronicle-recorder.\u00a0 I would not be opposed to a <a href=\"http:\/\/sourceware.org\/gdb\/wiki\/PythonGdb\">PythonGDB<\/a> solution, especially if VMware 6.5 still provides a gdb remote thinger (did the eclipse UI make that disappear?), although that would probably still be more crossings than I would like and perhaps slower (if less distorting) than an in-process or ptrace based solution.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>bsmedberg&#8216;s dxrpy likes to generate documentation using dehydra (bsmedberg&#8217;s blog posts on this: 1 2).\u00a0 I have added support for references\/referencedBy extraction and otherwise wailed on it a little bit, and run this against JUST comm-central&#8217;s mailnews\/ directory.\u00a0 The collection &hellip; <a href=\"https:\/\/www.visophyte.org\/blog\/2009\/02\/19\/dxrpy-with-references-against-mailnews-plus-bespin-wishes\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[7,3],"tags":[26],"class_list":["post-177","post","type-post","status-publish","format-standard","hentry","category-debugging","category-mozilla","tag-pecobro"],"_links":{"self":[{"href":"https:\/\/www.visophyte.org\/blog\/wp-json\/wp\/v2\/posts\/177","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.visophyte.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.visophyte.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.visophyte.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.visophyte.org\/blog\/wp-json\/wp\/v2\/comments?post=177"}],"version-history":[{"count":6,"href":"https:\/\/www.visophyte.org\/blog\/wp-json\/wp\/v2\/posts\/177\/revisions"}],"predecessor-version":[{"id":185,"href":"https:\/\/www.visophyte.org\/blog\/wp-json\/wp\/v2\/posts\/177\/revisions\/185"}],"wp:attachment":[{"href":"https:\/\/www.visophyte.org\/blog\/wp-json\/wp\/v2\/media?parent=177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.visophyte.org\/blog\/wp-json\/wp\/v2\/categories?post=177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.visophyte.org\/blog\/wp-json\/wp\/v2\/tags?post=177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}