From: Jorge Gorbe Date: Thu, 29 Nov 2012 18:40:37 +0000 (+0100) Subject: Plot sample. Slides. X-Git-Url: http://slack.codemaniacs.com/git/?a=commitdiff_plain;h=d5f005b4409df803c79f4be91bb75dbbcb1fd73b;p=resacon2012.git Plot sample. Slides. --- diff --git a/samples/view.py b/samples/view.py index e3ebb88..5820da9 100644 --- a/samples/view.py +++ b/samples/view.py @@ -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 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 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 index 0000000..91ec5de Binary files /dev/null and b/slides/ddd2.png differ diff --git a/slides/index.html b/slides/index.html index f79823c..a0e35fb 100644 --- a/slides/index.html +++ b/slides/index.html @@ -68,7 +68,8 @@
-

Anyway...

+

Let's talk about gdb anyway

+
@@ -329,29 +330,69 @@ DoNothingCommand() # and instance it
-

Demo

+

Demos

-

Did you know...?

-

GDB has many other semi-unknown cool features (which I won't talk about today)

- +

plotarray.py

+
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()
+
+

(simplified version)

-

Wish list

- +

view.py

+
+ +
+

Not exactly new ideas...

+

DDD did these things ages ago.

+ + +

BROTIP: Andreas Zeller, original author of DDD, has a nice + online course on debugging techniques + at Udacity

+
+ +
+
+

Did you know...?

+

GDB has many other semi-unknown cool features (which I won't talk about today)

+
    +
  • Debug info in external files
    Debug info can be moved from compiled objects to separate files, and still use it with gdb (like PDBs in VS)
  • +
  • Reverse debugging
    GDB can record (some finite amount of) program history and perform backwards stepping/running.
  • +
  • JIT interface
    A JIT can generate debug symbols and pass them on-the-fly to gdb to ease debugging (supported by LLVM!).
  • +
+
+ +
+

Wish list

+
    +
  • + Symbol and source server support
    + 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 Bruce Dawson's great post +
  • +
+
@@ -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 diff --git a/slides/reveal.js/css/theme/sky.css b/slides/reveal.js/css/theme/sky.css index 06da5c2..cb95196 100644 --- a/slides/reveal.js/css/theme/sky.css +++ b/slides/reveal.js/css/theme/sky.css @@ -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 index 0000000..b16c549 Binary files /dev/null and b/slides/yao.jpg differ