2
0

qthelper.py 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. from dumper import *
  2. def qdump__Beefy__String(d, value):
  3. qdump__Beefy__StringImpl(d, value)
  4. def qdump__Beefy__StringImpl(d, value):
  5. if (int(value["mAllocSizeAndFlags"]) & 0x40000000) == 0:
  6. d.putCharArrayHelper(d.addressOf(value["mPtr"]), value["mLength"], 1)
  7. else:
  8. d.putCharArrayHelper(value["mPtr"], value["mLength"], 1)
  9. d.putNumChild(2)
  10. if d.isExpanded():
  11. with Children(d):
  12. d.putIntItem("[Length]", value["mLength"])
  13. d.putIntItem("[Size]", int(value["mAllocSizeAndFlags"]) & 0x3FFFFFFF)
  14. def qdump__Beefy__Array(d, value):
  15. numItems = int(value["mSize"])
  16. d.putValue("Size=" + str(numItems))
  17. d.putNumChild(int(numItems) + 2)
  18. if d.isExpanded():
  19. with Children(d):
  20. d.putIntItem("[Size]", value["mSize"])
  21. d.putIntItem("[AllocSize]", value["mSize"])
  22. for i in range(0, int(numItems)):
  23. d.putSubItem("[" + str(i) + "]", value["mVals"] + i)
  24. def qdump__Beefy__BfSizedArray(d, value):
  25. numItems = int(value["mSize"])
  26. d.putValue("Size=" + str(numItems))
  27. d.putNumChild(int(numItems) + 1)
  28. if d.isExpanded():
  29. with Children(d):
  30. d.putIntItem("[Size]", value["mSize"])
  31. for i in range(0, int(numItems)):
  32. d.putSubItem("[" + str(i) + "]", value["mVals"] + i)
  33. def qdump__Beefy__BfAstNode(d, value):
  34. d.putCharArrayHelper(value["mSource"]["mSrc"] + int(value["mSrcStart"]), int(value["mSrcEnd"]) - int(value["mSrcStart"]), 1)
  35. d.putPlainChildren(value)
  36. def qdump__System__String(d, value):
  37. if (int(value["mAllocSizeAndFlags"]) & 0x40000000) == 0:
  38. d.putCharArrayHelper(d.addressOf(value["mPtr"]), value["mLength"], 1)
  39. else:
  40. d.putCharArrayHelper(value["mPtr"], value["mLength"], 1)
  41. d.putNumChild(2)
  42. if d.isExpanded():
  43. with Children(d):
  44. d.putIntItem("[Length]", value["mLength"])
  45. d.putIntItem("[Size]", int(value["mAllocSizeAndFlags"]) & 0x3FFFFFFF)
  46. def qdump__System__Collections__Generic__List(d, value):
  47. numItems = int(value["mSize"])
  48. d.putValue("Size=" + str(numItems))
  49. d.putNumChild(int(numItems) + 2)
  50. if d.isExpanded():
  51. with Children(d):
  52. d.putIntItem("[Size]", value["mSize"])
  53. d.putIntItem("[AllocSize]", value["mSize"])
  54. for i in range(0, int(numItems)):
  55. d.putSubItem("[" + str(i) + "]", value["mVals"] + i)