Skip to content

Instantly share code, notes, and snippets.

@Elv13
Created November 8, 2016 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Elv13/48b43ead347faba1b59378267d2364e7 to your computer and use it in GitHub Desktop.
Save Elv13/48b43ead347faba1b59378267d2364e7 to your computer and use it in GitHub Desktop.
(gdb) python import collections;d = collections.deque(maxlen=10)
(gdb) set height 0
(gdb) break main
(gdb) run
(gdb) watch hello_world
(gdb) commands
>python
>global d
>d.append(int(gdb.lookup_symbol("hello_world")[0].value(gdb.selected_frame())))
>end
> continue
>end
(gdb) continue
(gdb) python print(d)
import numpy as np
import matplotlib.pyplot as plt
ind = np.arange(len(d))
p1 = plt.bar(ind,xval,0.1,color='r')
ply.ylabel("Values")
plt.title("Values of hello_world")
plt.yticks(np.arange(0,81,10))
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment