Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. def f(x):
  2. sym = gdb.lookup_global_symbol(x)
  3. g(sym.type, x)
  4. def g(symtype, names):
  5. if (symtype.code == 3):
  6. for field in symtype.fields():
  7. g(field.type, names + '.' +field.name)
  8. if (symtype.code == 2):
  9. for index in range(symtype.range()[0], symtype.range()[1]+1):
  10. symarr = gdb.lookup_global_symbol(names+ '[' + str(index) + ']' )
  11. g(symtype.target(), names + '[' + str(index) + ']' )
  12. if (symtype.code == 8):
  13. print(names + ' = ' + str(int(gdb.parse_and_eval(names))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement