Plot sample. Slides.
authorJorge Gorbe <j.gorbe@stcsl.es>
Thu, 29 Nov 2012 18:40:37 +0000 (19:40 +0100)
committerJorge Gorbe <j.gorbe@stcsl.es>
Thu, 29 Nov 2012 18:40:37 +0000 (19:40 +0100)
samples/view.py
slides/data-struct-viewer.jpg [new file with mode: 0644]
slides/ddd1.png [new file with mode: 0644]
slides/ddd2.png [new file with mode: 0644]
slides/index.html
slides/reveal.js/css/theme/sky.css
slides/yao.jpg [new file with mode: 0644]

index e3ebb88d81ed69477818d345575ad852fdcf5a12..5820da9a6124494552a376159c56ec8510ff8587 100644 (file)
@@ -8,6 +8,12 @@ import math
 import random
 import sys, traceback
 
+# === NOTAS PARA LA ResaCON ===
+#
+# Funciones interesantes:
+# - find_outgoing_pointers
+# - GdbValueViewer.visit_value
+
 def address_to_uint(addr):
     return int(addr.cast(gdb.lookup_type("unsigned int")))
 
diff --git a/slides/data-struct-viewer.jpg b/slides/data-struct-viewer.jpg
new file mode 100644 (file)
index 0000000..a6f3e2e
Binary files /dev/null and b/slides/data-struct-viewer.jpg differ
diff --git a/slides/ddd1.png b/slides/ddd1.png
new file mode 100644 (file)
index 0000000..c9bbac0
Binary files /dev/null and b/slides/ddd1.png differ
diff --git a/slides/ddd2.png b/slides/ddd2.png
new file mode 100644 (file)
index 0000000..91ec5de
Binary files /dev/null and b/slides/ddd2.png differ
index f79823cbbe926a86e1f3ac37950db34f10c984a3..a0e35fba1d98498cab6630f02ccccdb4cc8e8664 100644 (file)
@@ -68,7 +68,8 @@
                 </section>
 
                 <section>
-                    <h1> Anyway... </h1>
+                    <h2>Let's talk about gdb anyway</h2>
+                    <img src="yao.jpg"> 
                 </section>
 
                 <section>
@@ -329,29 +330,69 @@ DoNothingCommand() # and instance it
                 </section>
 
                 <section>
-                <h1>Demo</h1>
+                    <h1>Demos</h1>
                 </section>
 
                 <section>
-                    <h2>Did you know...?</h2>
-                    <p> GDB has many other semi-unknown cool features (which I won't talk about today) </p>
-                    <ul>
-                        <li> <b>Debug info in external files</b> <br> Debug info can be moved from compiled objects to separate files, and still use it with gdb (like PDBs in VS)</li>
-                        <li> <b>Reverse debugging</b> <br> GDB can record (some finite amount of) program history and perform backwards stepping/running.  </li>
-                        <li> <b>JIT interface</b> <br> A JIT can generate debug symbols and pass them on-the-fly to gdb to ease debugging (supported by LLVM!). </li>
-                    </ul>
+                <h2>plotarray.py</h2>
+<pre><code>import gdb
+import matplotlib.pyplot as plt
+
+class PlotterCommand(gdb.Command):
+    def __init__(self):
+        super(PlotterCommand, self).__init__("plot",
+                                             gdb.COMMAND_DATA,
+                                             gdb.COMPLETE_SYMBOL)
+    def invoke(self, arg, from_tty):
+        args = gdb.string_to_argv(arg)
+        v = gdb.parse_and_eval(args[0])
+        t = v.type.strip_typedefs()
+        n = t.sizeof / t.target().sizeof
+        l = [float(v[i]) for i in range(n)]
+        plt.plot(l)
+        plt.show()
+        
+PlotterCommand()
+</code></pre>
+                <p><small>(simplified version)</small></p>
                 </section>
 
                 <section>
-                    <h2>Wish list</h2>
-                    <ul>
-                        <li> 
-                        <b>Symbol and source server support</b><br>
-                        Central store for symbols of every build, so you can always retrieve the correct version automatically
-                        without distributing debug info to users. Also, integration with SCM to retrieve the matching source code.
-                        See <a href="http://randomascii.wordpress.com/2011/11/11/source-indexing-is-underused-awesomeness/">Bruce Dawson's great post</a>
-                        </li>
-                    </ul>
+                <h2>view.py</h2>
+                </section>
+
+                <section>
+                    <h2>Not exactly new ideas...</h2>
+                    <p> <a href="http://www.gnu.org/software/ddd/">DDD</a> did these things ages ago.  </p>
+                    <img src="ddd1.png" width="400">
+                    <img src="ddd2.png" width="400">
+                    <p> <b>BROTIP:</b> Andreas Zeller, original author of DDD, has a nice 
+                    <a href="http://www.udacity.com/overview/Course/cs259/CourseRev/1">online course on debugging techniques</a>
+                    at Udacity </p>
+                </section>
+
+                <section>
+                    <section>
+                        <h2>Did you know...?</h2>
+                        <p> GDB has many other semi-unknown cool features (which I won't talk about today) </p>
+                        <ul>
+                            <li> <b>Debug info in external files</b> <br> Debug info can be moved from compiled objects to separate files, and still use it with gdb (like PDBs in VS)</li>
+                            <li> <b>Reverse debugging</b> <br> GDB can record (some finite amount of) program history and perform backwards stepping/running.  </li>
+                            <li> <b>JIT interface</b> <br> A JIT can generate debug symbols and pass them on-the-fly to gdb to ease debugging (supported by LLVM!). </li>
+                        </ul>
+                    </section>
+
+                    <section>
+                        <h2>Wish list</h2>
+                        <ul>
+                            <li> 
+                            <b>Symbol and source server support</b><br>
+                            Central store for symbols of every build, so you can always retrieve the correct version automatically
+                            without distributing debug info to users. Also, integration with SCM to retrieve the matching source code.
+                            See <a href="http://randomascii.wordpress.com/2011/11/11/source-indexing-is-underused-awesomeness/">Bruce Dawson's great post</a>
+                            </li>
+                        </ul>
+                    </section>
                 </section>
 
                 <section>
@@ -384,6 +425,7 @@ DoNothingCommand() # and instance it
                         controls: true,
                         progress: true,
                         history: true,
+                        rollingLinks: false,
 
                         theme: Reveal.getQueryHash().theme || "sky", // available themes are in /css/theme
                         transition: Reveal.getQueryHash().transition || 'linear', // default/cube/page/concave/zoom/linear/none
index 06da5c2d90cffe5f4f1bdd62af45fb11060d9fc7..cb9519625ee8599cbfa8476775c8624b284b431a 100644 (file)
@@ -85,8 +85,8 @@ body {
 .reveal section img {
   margin: 15px;
   background: rgba(255, 255, 255, 0.12);
-  border: 4px solid #333333;
-  box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
+  /*border: 4px solid #333333;*/
+  box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
   -webkit-transition: all .2s linear;
   -moz-transition: all .2s linear;
   -ms-transition: all .2s linear;
diff --git a/slides/yao.jpg b/slides/yao.jpg
new file mode 100644 (file)
index 0000000..b16c549
Binary files /dev/null and b/slides/yao.jpg differ