<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,86 +1,43 @@
-/*
- * We will discard whatever we captured unless
- * we have a dlopen -&gt; open -&gt; mmap call chain.
- */  
-
-BEGIN
-{
-  d = 0; /* depth */
-}
-
 pid$target::dlopen:entry
 /arg0/
 {
-  printf(&quot;opening %s\n&quot;, copyinstr(arg0));
+  self-&gt;path = copyinstr(arg0);
 }
 
-pid$target::dlopen:entry
-/arg0/
+pid$target::dlopen:return
+/self-&gt;path != 0/
 {
-  self-&gt;path[d] = copyinstr(arg0);
-  self-&gt;spec[d] = speculation();
-  d++;
-  speculate(self-&gt;spec[d]);
-
-  printf(&quot;\n\n&quot;);
-  printf(&quot;dlopen(\&quot;%s\&quot;, ...)\n&quot;, self-&gt;path[d]);
+  self-&gt;path = 0;
 }
 
-pid$target::open:entry
-/self-&gt;spec[d] &amp;&amp; self-&gt;path[d] != 0 &amp;&amp; self-&gt;path[d] == copyinstr(arg0)/
-{ 
-  speculate(self-&gt;spec[d]);
-  self-&gt;savefd[d] = 1;
-}
+/* opening the same file */
 
-pid$target::open:return
-/self-&gt;spec[d] &amp;&amp; self-&gt;savefd[d]/
-{
-  speculate(self-&gt;spec[d]);
-  self-&gt;fd[d] = arg1;
-  printf(&quot;  -&gt; open(\&quot;%s\&quot;, ...) = %d\n&quot;, self-&gt;path[d], self-&gt;fd[d]);
-}
-
-pid$target::mmap:entry
-/self-&gt;spec[d] &amp;&amp; self-&gt;fd[d] &amp;&amp; self-&gt;fd[d] == arg4/
+pid$target::open:entry
+/self-&gt;path != 0 &amp;&amp; self-&gt;path == copyinstr(arg0)/
 {
-  speculate(self-&gt;spec[d]);
-  self-&gt;mmap_addr[d] = arg0;
-  self-&gt;mmap_len[d] = arg1;
-  self-&gt;mmap_fd[d] = arg4;
-  self-&gt;mmap_offset[d] = arg5;
-  printf(&quot;   -&gt; mmap(%x, %u, ..., ..., %d, %u)\n&quot;, 
-    self-&gt;mmap_addr[d], self-&gt;mmap_len[d], 
-    self-&gt;mmap_fd[d], self-&gt;mmap_offset[d]);
+  self-&gt;savefd = 1;
 }
 
-pid$target::dlopen:return
-/self-&gt;spec[d] &amp;&amp; self-&gt;fd[d]/
-{
-  commit(self-&gt;spec[d]);
-  self-&gt;spec[d] = 0;
-}
+/* save file descriptor of a dlopen-ed library */
 
-pid$target::dlopen:return
-/self-&gt;spec[d]/
+pid$target::open:return
+/self-&gt;savefd/
 {
-  discard(self-&gt;spec[d]);
-  self-&gt;spec[d] = 0;
+  self-&gt;fd[arg1] = self-&gt;path;
+  self-&gt;savefd = 0;
 }
 
-pid$target::dlopen:return
-{
-  self-&gt;path[d] = 0;
-  self-&gt;savefd[d] = 0;
-  self-&gt;fd[d] = 0;
-}
+/* mmap-ing a library we know about */
 
-pid$target::dlopen:return
-/d &gt; 0/
+pid$target::mmap:entry
+/self-&gt;fd[arg4] != 0/
 {
-  d--;
+  self-&gt;mmap_addr = arg0;
+  self-&gt;mmap_len = arg1;
+  self-&gt;mmap_fd = arg4;
+  self-&gt;mmap_offset = arg5;
+  this-&gt;path = self-&gt;fd[arg4];
+  
+  printf(&quot;mapping %u bytes of %s from offset %d to address 0x%x\n\n&quot;,
+    self-&gt;mmap_len, this-&gt;path, self-&gt;mmap_offset, self-&gt;mmap_addr);
 }
-
-
-
-</diff>
      <filename>lib.d</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a46daf9087f0e88d080118980577e787e502537a</id>
    </parent>
  </parents>
  <author>
    <name>wagerlabs</name>
    <email>joelr1@gmail.com</email>
  </author>
  <url>http://github.com/wagerlabs/firefox-startup/commit/6bc117cf5f962a89bf81ff6ac5c6d50912e26ae4</url>
  <id>6bc117cf5f962a89bf81ff6ac5c6d50912e26ae4</id>
  <committed-date>2009-10-25T13:22:02-07:00</committed-date>
  <authored-date>2009-10-25T13:22:02-07:00</authored-date>
  <message>more or less working</message>
  <tree>4da01bba5d1b2cdab3f2b75e09e951706374085b</tree>
  <committer>
    <name>wagerlabs</name>
    <email>joelr1@gmail.com</email>
  </committer>
</commit>
