[PATCH] D88988: [llvm-symbolizer] Add inline stack traces for Windows.

Amy Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 20 17:41:13 PDT 2020


akhuang added a comment.

Hm, ok. Here's the assembly around GetCurrentPc. I haven't looked too far into it, but I guess I'll put it here for now.

On Linux:

  .LBB4_9:
      callq   _ZN11__sanitizer10StackTrace12GetCurrentPcEv at PLT
  .Ltmp72:
      movq    %rax, %r12
      movq    _ZN11__sanitizer21common_flags_dont_useE at GOTPCREL(%rip), %rax
      movb    34(%rax), %bl 
      callq   _ZN6__asan20GetMallocContextSizeEv at PLT
  .Ltmp73:
      .loc    2 0 3 is_stmt 0                 # llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:0:3
      xorl    %ecx, %ecx
  .Ltmp74:
      .loc    3 116 31 is_stmt 1              # llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_stacktrace.h:116:31

On Windows:

  .LBB9_4:                                # %if.else
    #DEBUG_VALUE: calloc:size <- $r15
    #DEBUG_VALUE: calloc:nmemb <- $rdi
    .cv_loc 16 2 114 0                      # C:/src/llvm-project/compiler-rt/lib/asan/asan_malloc_win.cpp:114:0
    mov sil, byte ptr [rip + "?common_flags_dont_use at __sanitizer@@3UCommonFlags at 1@A"+34]
    lea r14, [rbp - 128]
    call  "?GetCurrentPc at StackTrace@__sanitizer@@SA_KXZ"
    xor ecx, ecx
  .Ltmp70:
    #DEBUG_VALUE: Unwind:this <- [DW_OP_constu 80, DW_OP_minus, DW_OP_stack_value] $rbp
    #DEBUG_VALUE: Unwind:context <- 0
    #DEBUG_VALUE: Unwind:request_fast <- [DW_OP_LLVM_convert 1 7, DW_OP_LLVM_convert 8 7, DW_OP_stack_value] undef
    #DEBUG_VALUE: Unwind:max_depth <- $ebx
    #DEBUG_VALUE: Unwind:pc <- $rax
    #DEBUG_VALUE: Unwind:bp <- $r14
    .cv_inline_site_id 19 within 16 inlined_at 2 114 0
    .cv_loc 19 3 116 0                      # C:/src/llvm-project/compiler-rt/lib\sanitizer_common/sanitizer_stacktrace.h:116:0


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88988/new/

https://reviews.llvm.org/D88988



More information about the llvm-commits mailing list