Guest User

After the changes

a guest
May 7th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.08 KB | None | 0 0
  1. #include "gwp_asan/guarded_pool_allocator.h"
  2.  
  3. gwp_asan::GuardedPoolAllocator *GPA;
  4. extern "C" bool AsmDumpHelperFunc() {
  5. return GPA->shouldSample();
  6. }
  7.  
  8.  
  9. =======================================================================================
  10.  
  11. =======================================================================================
  12. 0000000000000000 <AsmDumpHelperFunc>:
  13. AsmDumpHelperFunc():
  14. //llvm/compiler-rt/lib/gwp_asan/shouldsample_donotsubmit.cpp:4
  15. #include "gwp_asan/guarded_pool_allocator.h"
  16.  
  17. gwp_asan::GuardedPoolAllocator *GPA;
  18. extern "C" bool AsmDumpHelperFunc() {
  19. 0: 41 57 push %r15
  20. 2: 41 56 push %r14
  21. 4: 53 push %rbx
  22. //llvm/compiler-rt/lib/gwp_asan/shouldsample_donotsubmit.cpp:5
  23. return GPA->shouldSample();
  24. 5: 48 8b 05 00 00 00 00 mov 0x0(%rip),%rax # c <AsmDumpHelperFunc+0xc>
  25. c: 4c 8b 30 mov (%rax),%r14
  26. //llvm/compiler-rt/lib/gwp_asan/../gwp_asan/guarded_pool_allocator.h:100
  27.  
  28. // Return whether the allocation should be randomly chosen for sampling.
  29. ALWAYS_INLINE bool shouldSample() {
  30. // NextSampleCounter == 0 means we "should regenerate the counter".
  31. // == 1 means we "should sample this allocation".
  32. if (UNLIKELY(NextSampleCounter == 0))
  33. f: 48 83 3d 00 00 00 00 cmpq $0x0,0x0(%rip) # 17 <AsmDumpHelperFunc+0x17>
  34. 16: 00
  35. 17: 74 05 je 1e <AsmDumpHelperFunc+0x1e>
  36. 19: e8 00 00 00 00 callq 1e <AsmDumpHelperFunc+0x1e>
  37. 1e: 4c 8b 3d 00 00 00 00 mov 0x0(%rip),%r15 # 25 <AsmDumpHelperFunc+0x25>
  38. 25: 64 49 8b 1f mov %fs:(%r15),%rbx
  39. 29: 48 85 db test %rbx,%rbx
  40. 2c: 74 29 je 57 <AsmDumpHelperFunc+0x57>
  41. //llvm/compiler-rt/lib/gwp_asan/../gwp_asan/guarded_pool_allocator.h:105
  42. NextSampleCounter =
  43. (random::getRandomUnsigned64() % AdjustedSampleRate) + 1;
  44.  
  45. // GuardedPagePool != 0 if GWP-ASan is enabled.
  46. return UNLIKELY(NextSampleCounter-- == 1) && LIKELY(GuardedPagePool != 0);
  47. 2e: 48 83 3d 00 00 00 00 cmpq $0x0,0x0(%rip) # 36 <AsmDumpHelperFunc+0x36>
  48. 35: 00
  49. 36: 74 09 je 41 <AsmDumpHelperFunc+0x41>
  50. 38: e8 00 00 00 00 callq 3d <AsmDumpHelperFunc+0x3d>
  51. 3d: 64 49 8b 1f mov %fs:(%r15),%rbx
  52. 41: 48 8d 43 ff lea -0x1(%rbx),%rax
  53. 45: 64 49 89 07 mov %rax,%fs:(%r15)
  54. 49: 48 83 fb 01 cmp $0x1,%rbx
  55. 4d: 74 39 je 88 <AsmDumpHelperFunc+0x88>
  56. 4f: 31 c0 xor %eax,%eax
  57. //llvm/compiler-rt/lib/gwp_asan/shouldsample_donotsubmit.cpp:5
  58. 51: 5b pop %rbx
  59. 52: 41 5e pop %r14
  60. 54: 41 5f pop %r15
  61. 56: c3 retq
  62. //llvm/compiler-rt/lib/gwp_asan/../gwp_asan/guarded_pool_allocator.h:102
  63. (random::getRandomUnsigned64() % AdjustedSampleRate) + 1;
  64. 57: e8 00 00 00 00 callq 5c <AsmDumpHelperFunc+0x5c>
  65. 5c: 31 d2 xor %edx,%edx
  66. 5e: 49 f7 76 58 divq 0x58(%r14)
  67. 62: 48 89 d3 mov %rdx,%rbx
  68. 65: 48 83 c3 01 add $0x1,%rbx
  69. //llvm/compiler-rt/lib/gwp_asan/../gwp_asan/guarded_pool_allocator.h:101
  70. NextSampleCounter =
  71. 69: 48 83 3d 00 00 00 00 cmpq $0x0,0x0(%rip) # 71 <AsmDumpHelperFunc+0x71>
  72. 70: 00
  73. 71: 74 05 je 78 <AsmDumpHelperFunc+0x78>
  74. 73: e8 00 00 00 00 callq 78 <AsmDumpHelperFunc+0x78>
  75. 78: 64 49 89 1f mov %rbx,%fs:(%r15)
  76. //llvm/compiler-rt/lib/gwp_asan/../gwp_asan/guarded_pool_allocator.h:105
  77. return UNLIKELY(NextSampleCounter-- == 1) && LIKELY(GuardedPagePool != 0);
  78. 7c: 48 83 3d 00 00 00 00 cmpq $0x0,0x0(%rip) # 84 <AsmDumpHelperFunc+0x84>
  79. 83: 00
  80. 84: 75 b2 jne 38 <AsmDumpHelperFunc+0x38>
  81. 86: eb b9 jmp 41 <AsmDumpHelperFunc+0x41>
  82. 88: 49 83 7e 20 00 cmpq $0x0,0x20(%r14)
  83. 8d: 0f 95 c0 setne %al
  84. 90: eb bf jmp 51 <AsmDumpHelperFunc+0x51>
Advertisement
Add Comment
Please, Sign In to add comment