Advertisement
bolverk

debug_helper

Mar 18th, 2015
454
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.76 KB | None | 0 0
  1. import matplotlib
  2. matplotlib.use('Qt4Agg')
  3. import pylab
  4. import numpy
  5. import gdb
  6.  
  7. buf = gdb.execute('b hdsim2d.cpp:332', to_string=True)
  8. buf = gdb.execute('r',to_string=True)
  9. tracer_number = gdb.parse_and_eval('tracer_.size()')
  10. x_list = []
  11. y_list = []
  12. t_list = []
  13. for i in range(tracer_number):
  14.     if(i%1000==0):
  15.         print(i)
  16.     x_list.append(float(gdb.parse_and_eval('_tessellation.GetMeshPoint('+str(i)+').x')))
  17.     y_list.append(float(gdb.parse_and_eval('_tessellation.GetMeshPoint('+str(i)+').y')))
  18.     t_list.append(float(gdb.execute('p tracer_['+str(i)+'][1]',
  19.                                     to_string=True).split()[-1]))
  20. pylab.tricontourf(x_list, y_list, t_list)
  21. pylab.colorbar()
  22. pylab.scatter(x_list, y_list)
  23. pylab.show()
  24. exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement