[lldb-dev] [Bug 37485] New: LLDB reads wrong registers on 64bit Windows

via lldb-dev lldb-dev at lists.llvm.org
Wed May 16 05:57:16 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37485

            Bug ID: 37485
           Summary: LLDB reads wrong registers on 64bit Windows
           Product: lldb
           Version: 6.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: kenji.koyanagi at gmail.com
                CC: llvm-bugs at lists.llvm.org

LLDB reads wrong registers on 64bit Windows because
RegisterContextWindows_x64::GetRegisterInfoAtIndex returns wrong reference.
I encountered broken backtrace when the program stopped at function which does
not have prologue code, such as compiled with '-fomit-frame-pointer'.
In this situation, CFA is equal to rsp but LLDB reads r9.

I investigated the cause.
RegisterContextWindows_x64::GetRegisterInfoAtIndex depends the order of
lldb_XXX_x86_64 values, but RegisterIndex/g_register_infos/g_gpr_reg_indices
does not follow order.

In source/Plugins/Process/Utility/lldb-x86-register-enums.h
The order of GPRs is rax, rbx, rcx, rdx, rdi, rsi, rbp, rsp, r8, ...

In source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
The order of GPRs is rax, rbx, rcx, rdx, rdi, rsi, r8, r9, r10, ...

I am using is what I built by myself on MinGW.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20180516/442ecdea/attachment.html>


More information about the lldb-dev mailing list