Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
GDB 0.49 KB | None | 0 0
  1. def swap_endianess_16(x):
  2.     return int.from_bytes(x.to_bytes(2, byteorder='little'), byteorder='big', signed=False)
  3.  
  4. class uint16bg_t_print:
  5.     def __init__(self, val):
  6.         self.val = val
  7.     def to_string(self):
  8.         return self.val['val'].string()
  9.  
  10. def lookup_type_uint16bg_t (val):
  11.     if 'uint16bg_t' in str(val.type):
  12.         return uint16bg_t_print(val)
  13.     return None
  14.  
  15. gdb.pretty_printers.append(lookup_type_uint16bg_t)
  16. # gdb.pretty_printers.append(lookup_type_uint32bg_t)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement